diff options
author | thsparks <thsparks@microsoft.com> | 2022-03-16 20:40:16 +0300 |
---|---|---|
committer | thsparks <thsparks@microsoft.com> | 2022-03-16 20:40:16 +0300 |
commit | e376046d6bdb0533d943e76a615081d476354477 (patch) | |
tree | b596bfd2257aafff6eabe860ddbda143952b18ba | |
parent | 6359edaa5c81a0d1697a1ad36807b74388f8ebb2 (diff) |
Diable MicroBuild signing by default, then only enable it after compilation.
This way, if compilation is skipped because it the project has already been built, signing will remain turned off and we will not redundantly submit already-signed files to sign.
-rw-r--r-- | Directory.Build.targets | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Directory.Build.targets b/Directory.Build.targets index f84eb8f..94620d4 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -3,4 +3,28 @@ <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Xamarin.PropertyEditing.snk</AssemblyOriginatorKeyFile> <SignAssembly>true</SignAssembly> </PropertyGroup> + + <PropertyGroup> + <!-- + Diable MicroBuild signing by default, then only enable it after compilation. + This way, if compilation is skipped because it the project has already been built, signing + will remain turned off and we will not redundantly submit already-signed files to sign. + + This property group must remain in Directory.Build.targets file (as opposed to *.props) because + the initial MicroBuild_SigningEnabled value is not set until after Directory.Build.props has been processed. + --> + <MicroBuild_SigningEnabled_Old>$(MicroBuild_SigningEnabled)</MicroBuild_SigningEnabled_Old> + <MicroBuild_SigningEnabled>false</MicroBuild_SigningEnabled> + + <TargetsTriggeredByCompilation> + $(TargetsTriggeredByCompilation); + EnableMicroBuildSigningPostCompile + </TargetsTriggeredByCompilation> + </PropertyGroup> + + <Target Name="EnableMicroBuildSigningPostCompile"> + <PropertyGroup> + <MicroBuild_SigningEnabled>$(MicroBuild_SigningEnabled_Old)</MicroBuild_SigningEnabled> + </PropertyGroup> + </Target> </Project> |