forked from OpenCover/opencover
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OpenCover#346 from OpenCover/master
Create release candidate
- Loading branch information
Showing
64 changed files
with
2,333 additions
and
580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
using Mono.Cecil; | ||
|
||
namespace OpenCover.ThirdParty.Signer | ||
{ | ||
internal static class CrashReporterSigner | ||
{ | ||
|
||
private const string Version = "1.5"; | ||
|
||
private static readonly string GendarmeAssemblyName = string.Format("CrashReporterdotNet.{0}", Version); | ||
|
||
public static readonly string TargetFolder = Path.Combine("..", "tools", "CrashReporterSigned"); | ||
private static readonly string SourceFolder = Path.Combine("packages", GendarmeAssemblyName, "lib", "net20"); | ||
private static readonly string StrongNameKey = Path.Combine("..", "build", "Version", "opencover.3rdparty.snk"); | ||
|
||
|
||
public static bool AlreadySigned(string baseFolder) | ||
{ | ||
var frameworkAssembly = Path.Combine(baseFolder, TargetFolder, "CrashReporter.NET.dll"); | ||
if (File.Exists(frameworkAssembly)) | ||
{ | ||
try | ||
{ | ||
var frameworkDefinition = AssemblyDefinition.ReadAssembly(frameworkAssembly); | ||
return frameworkDefinition.Name.HasPublicKey; | ||
} | ||
catch | ||
{ | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public static void SignAssembly(string baseFolder) | ||
{ | ||
var key = Path.Combine(baseFolder, StrongNameKey); | ||
var assembly = Path.Combine(baseFolder, SourceFolder, "CrashReporter.NET.dll"); | ||
var newAssembly = Path.Combine(baseFolder, TargetFolder, "CrashReporter.NET.dll"); | ||
|
||
assembly = Path.GetFullPath(assembly); | ||
newAssembly = Path.GetFullPath(newAssembly); | ||
|
||
File.Copy(assembly, newAssembly, true); | ||
var definition = AssemblyDefinition.ReadAssembly(newAssembly); | ||
var keyPair = new StrongNameKeyPair(new FileStream(key, FileMode.Open, FileAccess.Read)); | ||
definition.Write(newAssembly, new WriterParameters() { StrongNameKeyPair = keyPair }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
|
||
namespace OpenCover.ThirdParty.Signer | ||
{ | ||
class Program | ||
{ | ||
|
||
static void Main(string[] args) | ||
{ | ||
var assemblyLocation = Assembly.GetAssembly (typeof(Program)).Location; | ||
var assemblyFolder = Path.GetDirectoryName(assemblyLocation) ?? string.Empty; | ||
var baseFolder = Path.Combine(assemblyFolder, "..", "..", ".."); | ||
|
||
SignGendarme(baseFolder); | ||
SignCrashReporter(baseFolder); | ||
} | ||
|
||
private static void SignGendarme(string baseFolder) | ||
{ | ||
var targetDirectory = Path.Combine(baseFolder, GendarmeSigner.TargetFolder); | ||
if (!Directory.Exists(targetDirectory)) | ||
Directory.CreateDirectory(targetDirectory); | ||
|
||
if (GendarmeSigner.AlreadySigned(baseFolder)) | ||
{ | ||
Console.WriteLine("Gendarme Framework is already Signed"); | ||
return; | ||
} | ||
|
||
Console.WriteLine("Signing Gendarme Framework"); | ||
GendarmeSigner.SignGendarmeFramework(baseFolder); | ||
|
||
Console.WriteLine("Signing Gendarme Rules Maintainability"); | ||
GendarmeSigner.SignGendarmeRulesMaintainability(baseFolder); | ||
} | ||
|
||
private static void SignCrashReporter(string baseFolder) | ||
{ | ||
var targetDirectory = Path.Combine(baseFolder, CrashReporterSigner.TargetFolder); | ||
if (!Directory.Exists(targetDirectory)) | ||
Directory.CreateDirectory(targetDirectory); | ||
|
||
if (CrashReporterSigner.AlreadySigned(baseFolder)) | ||
{ | ||
Console.WriteLine("CrashReporter is already Signed"); | ||
return; | ||
} | ||
|
||
Console.WriteLine("Signing CrashReporter"); | ||
CrashReporterSigner.SignAssembly(baseFolder); | ||
|
||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
|
||
namespace OpenCover.Console.CrashReporter | ||
{ | ||
/// <summary> | ||
/// http://crashreporterdotnet.codeplex.com/SourceControl/latest#CrashReporter.NET/trunk/CrashReporter.NET/DrDump/AnonymousData.cs | ||
/// </summary> | ||
internal class AnonymousData | ||
{ | ||
public Exception Exception { get; set; } | ||
public string ToEmail { get; set; } | ||
public Guid? ApplicationGuid { get; set; } | ||
} | ||
} |
Oops, something went wrong.