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 + + diff --git a/main/OpenCover.Integration.Test/OpenCover.Integration.Test.csproj b/main/OpenCover.Integration.Test/OpenCover.Integration.Test.csproj index e6453b5b1..301a0d47e 100644 --- a/main/OpenCover.Integration.Test/OpenCover.Integration.Test.csproj +++ b/main/OpenCover.Integration.Test/OpenCover.Integration.Test.csproj @@ -69,7 +69,7 @@ - +