Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.nuspec
  • Loading branch information
brutaldev committed May 10, 2021
2 parents 7a78571 + 1e5b1b8 commit 8f1fb4c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Brutal.Dev.StrongNameSigner/AutomaticBuildTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ public override bool Execute()
if (!signedAssembly.IsSigned)
{
signedAssembly = SignSingleAssembly(References[i].ItemSpec, snkFilePath, signedAssemblyFolder, probingPaths);
chagesMade = true;
if(signedAssembly != null)
{
chagesMade = true;
}
}

if (signedAssembly.IsSigned)
if (signedAssembly != null && signedAssembly.IsSigned)
{
signedAssemblyPaths.Add(signedAssembly.FilePath);
processedAssemblyPaths.Add(signedAssembly.FilePath);
Expand Down Expand Up @@ -185,6 +188,7 @@ private AssemblyInfo SignSingleAssembly(string assemblyPath, string keyPath, str
else
{
Log.LogMessage(MessageImportance.Low, "Strong-name signature already applied to '{0}'...", assemblyPath);
Log.LogMessage(MessageImportance.Low, "Original assembly IsSigned: {0}, After signing attempt IsSigned: {1}", oldInfo.IsSigned.ToString(), newInfo.IsSigned.ToString());
}
}
catch (BadImageFormatException ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,12 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.6.2.0\build\StyleCop.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.6.2.0\build\StyleCop.MSBuild.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>REM requires installing nuget commandline. example using chocolatey:
REM choco install nuget.commandline
REM note: output dir cannot end in slash
if /I "$(ConfigurationName)" == "Release" nuget.exe pack $(ProjectDir)..\Brutal.Dev.StrongNameSigner.Setup\StrongNameSigner.nuspec -Properties "Configuration=$(Configuration)" -NonInteractive -OutputDirectory "$(ProjectDir)bin\$(ConfigurationName)

if /I "$(ConfigurationName)" == "Release" "$(SystemRoot)\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /p:CleanIntermediates=True /p:Configuration=Release "$(SolutionDir)Brutal.Dev.StrongNameSigner.Docs\Documentation.shfbproj"</PostBuildEvent>
</PropertyGroup>
</Project>

0 comments on commit 8f1fb4c

Please sign in to comment.