From 584299795540c648221281210b25d0469fbb09ca Mon Sep 17 00:00:00 2001 From: molnargab Date: Wed, 11 Feb 2015 23:32:27 +0100 Subject: [PATCH 1/8] fix NuGet references for Linux --- main/.nuget/NuGet.targets | 2 +- main/OpenCover.Console/OpenCover.Console.csproj | 2 +- main/OpenCover.Extensions/OpenCover.Extensions.csproj | 2 +- main/OpenCover.Framework/OpenCover.Framework.csproj | 2 +- main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj | 2 +- .../OpenCover.Integration.Test.csproj | 2 +- main/OpenCover.Specs/OpenCover.Specs.csproj | 2 +- main/OpenCover.Test/OpenCover.Test.csproj | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/.nuget/NuGet.targets b/main/.nuget/NuGet.targets index 2d11ba558..4f2439166 100644 --- a/main/.nuget/NuGet.targets +++ b/main/.nuget/NuGet.targets @@ -41,7 +41,7 @@ - $(NuGetToolsPath)\nuget.exe + $(NuGetToolsPath)\NuGet.exe @(PackageSource) "$(NuGetExePath)" diff --git a/main/OpenCover.Console/OpenCover.Console.csproj b/main/OpenCover.Console/OpenCover.Console.csproj index 655432015..c62fc381b 100644 --- a/main/OpenCover.Console/OpenCover.Console.csproj +++ b/main/OpenCover.Console/OpenCover.Console.csproj @@ -139,7 +139,7 @@ - + - \ No newline at end of file + diff --git a/main/OpenCover.Gendarme.Signer/Program.cs b/main/OpenCover.Gendarme.Signer/Program.cs index b4b2996ae..8ae24e077 100644 --- a/main/OpenCover.Gendarme.Signer/Program.cs +++ b/main/OpenCover.Gendarme.Signer/Program.cs @@ -11,18 +11,23 @@ namespace OpenCover.Gendarme.Signer { class Program { - private const string TargetFolder = @"..\tools\GendarmeSigned"; - private const string SourceFolder = @"packages\Mono.Gendarme.2.11.0.20121120\tools"; - private const string StrongNameKey = @"..\build\Version\opencover.gendarme.snk"; + private const string GendarmeVersion = "2.11.0.20121120"; - static void Main(string[] args) - { + private static readonly string GendarmeAssemblyName = string.Format("Mono.Gendarme.{0}", GendarmeVersion); + private static readonly string TargetFolder = Path.Combine("..", "tools", "GendarmeSigned"); + private static readonly string SourceFolder = Path.Combine("packages", GendarmeAssemblyName, "tools"); + private static readonly string StrongNameKey = Path.Combine("..", "build", "Version", "opencover.gendarme.snk"); - var baseFolder = Path.Combine(Assembly.GetAssembly(typeof(Program)).Location, @"..\..\..\.."); + static void Main(string[] args) + { + var assemblyLocation = Assembly.GetAssembly (typeof(Program)).Location; + var assemblyFolder = Path.GetDirectoryName(assemblyLocation); + var baseFolder = Path.Combine(assemblyFolder, "..", "..", ".."); - if (!Directory.Exists(Path.Combine(baseFolder, TargetFolder))) - Directory.CreateDirectory(Path.Combine(baseFolder, TargetFolder)); + var targetDirectory = Path.Combine (baseFolder, TargetFolder); + if (!Directory.Exists(targetDirectory)) + Directory.CreateDirectory (targetDirectory); if (AlreadySigned(baseFolder)) { @@ -39,7 +44,7 @@ static void Main(string[] args) private static bool AlreadySigned(string baseFolder) { - var frameworkAssembly = Path.Combine(baseFolder, TargetFolder + @"\Gendarme.Framework.dll"); + var frameworkAssembly = Path.Combine(baseFolder, TargetFolder, "Gendarme.Framework.dll"); if (File.Exists(frameworkAssembly)) { try @@ -56,13 +61,13 @@ private static bool AlreadySigned(string baseFolder) private static void SignGendarmeRulesMaintainability(string baseFolder) { - var frameworkAssembly = Path.Combine(baseFolder, TargetFolder + @"\Gendarme.Framework.dll"); + var frameworkAssembly = Path.Combine(baseFolder, TargetFolder, "Gendarme.Framework.dll"); var frameworkDefinition = AssemblyDefinition.ReadAssembly(frameworkAssembly); var frameworkAssemblyRef = AssemblyNameReference.Parse(frameworkDefinition.Name.ToString()); var key = Path.Combine(baseFolder, StrongNameKey); - var assembly = Path.Combine(baseFolder, SourceFolder + @"\Gendarme.Rules.Maintainability.dll"); - var newAssembly = Path.Combine(baseFolder, TargetFolder + @"\Gendarme.Rules.Maintainability.dll"); + var assembly = Path.Combine(baseFolder, SourceFolder, "Gendarme.Rules.Maintainability.dll"); + var newAssembly = Path.Combine(baseFolder, TargetFolder, "Gendarme.Rules.Maintainability.dll"); assembly = Path.GetFullPath(assembly); newAssembly = Path.GetFullPath(newAssembly); @@ -95,8 +100,8 @@ private static void SignGendarmeRulesMaintainability(string baseFolder) private static void SignGendarmeFramework(string baseFolder) { var key = Path.Combine(baseFolder, StrongNameKey); - var assembly = Path.Combine(baseFolder, SourceFolder + @"\Gendarme.Framework.dll"); - var newAssembly = Path.Combine(baseFolder, TargetFolder + @"\Gendarme.Framework.dll"); + var assembly = Path.Combine(baseFolder, SourceFolder, "Gendarme.Framework.dll"); + var newAssembly = Path.Combine(baseFolder, TargetFolder, "Gendarme.Framework.dll"); assembly = Path.GetFullPath(assembly); newAssembly = Path.GetFullPath(newAssembly); diff --git a/main/OpenCover.Gendarme.Signer/packages.config b/main/OpenCover.Gendarme.Signer/packages.config index 30c70da32..afb074f2a 100644 --- a/main/OpenCover.Gendarme.Signer/packages.config +++ b/main/OpenCover.Gendarme.Signer/packages.config @@ -1,4 +1,5 @@  - \ No newline at end of file + + From e5b4b56f99b8106eab875354bb974cbb7b722451 Mon Sep 17 00:00:00 2001 From: molnargab Date: Tue, 3 Feb 2015 00:37:20 +0100 Subject: [PATCH 4/8] fix post build event to use current dir --- .../OpenCover.Gendarme.Signer.csproj | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj b/main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj index f80ce31e2..c8fa3f5f2 100644 --- a/main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj +++ b/main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj @@ -70,12 +70,10 @@ - - cd $(SolutionDir)OpenCover.Gendarme.Signer\bin\$(ConfigurationName) + + cd $(SolutionDir)OpenCover.Gendarme.Signer\bin\$(ConfigurationName) $(SolutionDir)OpenCover.Gendarme.Signer\bin\$(ConfigurationName)\OpenCover.Gendarme.Signer.exe - - - mono $(SolutionDir)\OpenCover.Gendarme.Signer\bin\$(ConfigurationName)\OpenCover.Gendarme.Signer.exe + mono OpenCover.Gendarme.Signer.exe