Skip to content

Commit

Permalink
Switch over to microbuild signing.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenMolloy committed May 21, 2018
1 parent 39e9081 commit 4887033
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 4 deletions.
2 changes: 0 additions & 2 deletions MicrosoftConfigurationBuilders.msbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="tools\MicrosoftConfigurationBuilders.settings.targets"/>

<ItemGroup>
<AssemblyProject Include="src\Base\Base.csproj" />
<AssemblyProject Include="src\Environment\Environment.csproj" />
Expand Down
8 changes: 8 additions & 0 deletions src/Azure/Azure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,12 @@
<Error Condition="!Exists('..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.1\build\Microsoft.Azure.Services.AppAuthentication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.1\build\Microsoft.Azure.Services.AppAuthentication.targets'))" />
</Target>
<Import Project="..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.1\build\Microsoft.Azure.Services.AppAuthentication.targets" Condition="Exists('..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.1\build\Microsoft.Azure.Services.AppAuthentication.targets')" />
<Target Name="AfterBuild">
<ItemGroup>
<FilesToSign Include="$(TargetPath)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>Microsoft</Authenticode>
<StrongName>MsSharedLib72</StrongName>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
8 changes: 8 additions & 0 deletions src/Base/Base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),MicrosoftConfigurationBuilders.sln))\tools\cleanup.targets" />
<Target Name="AfterBuild">
<ItemGroup>
<FilesToSign Include="$(TargetPath)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>Microsoft</Authenticode>
<StrongName>MsSharedLib72</StrongName>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
8 changes: 8 additions & 0 deletions src/Environment/Environment.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),MicrosoftConfigurationBuilders.sln))\tools\cleanup.targets" />
<Target Name="AfterBuild">
<ItemGroup>
<FilesToSign Include="$(TargetPath)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>Microsoft</Authenticode>
<StrongName>MsSharedLib72</StrongName>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
8 changes: 8 additions & 0 deletions src/Json/Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,12 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),MicrosoftConfigurationBuilders.sln))\tools\cleanup.targets" />
<Target Name="AfterBuild">
<ItemGroup>
<FilesToSign Include="$(TargetPath)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>Microsoft</Authenticode>
<StrongName>MsSharedLib72</StrongName>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
8 changes: 8 additions & 0 deletions src/UserSecrets/UserSecrets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),MicrosoftConfigurationBuilders.sln))\tools\cleanup.targets" />
<Target Name="AfterBuild">
<ItemGroup>
<FilesToSign Include="$(TargetPath)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>Microsoft</Authenticode>
<StrongName>MsSharedLib72</StrongName>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@
</NuGetContent>
</ItemGroup>
<Import Project="$(RepositoryRoot)Tools\NuGetProj.targets"/>
<Target Name="AfterBuild">
<PropertyGroup>
<OutDir>$(PackageOutputDir)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@
</NuGetContent>
</ItemGroup>
<Import Project="$(RepositoryRoot)Tools\NuGetProj.targets"/>
<Target Name="AfterBuild">
<PropertyGroup>
<OutDir>$(PackageOutputDir)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@
</NuGetContent>
</ItemGroup>
<Import Project="$(RepositoryRoot)Tools\NuGetProj.targets"/>
<Target Name="AfterBuild">
<PropertyGroup>
<OutDir>$(PackageOutputDir)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@
</NuGetContent>
</ItemGroup>
<Import Project="$(RepositoryRoot)Tools\NuGetProj.targets"/>
<Target Name="AfterBuild">
<PropertyGroup>
<OutDir>$(PackageOutputDir)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,35 @@
<NuGetContent Include="build\Net471\$(NuGetPackageId).targets">
<Destination>build\Net471\$(NuGetPackageId).targets</Destination>
</NuGetContent>
<NuGetContent Include="tools\Net471\*.ps1">
<NuGetContent Include="tools\Net471\*.ps1" Condition="'$(SignAssembly)' != 'true'">
<Destination>tools\Net471\</Destination>
</NuGetContent>
<NuGetContent Include="tools\Net471\signed\*.ps1" Condition="'$(SignAssembly)' == 'true'">
<Destination>tools\Net471\</Destination>
</NuGetContent>
</ItemGroup>
<Import Project="$(RepositoryRoot)Tools\NuGetProj.targets"/>
<Target Name="SignPowerShellScript" Condition=" '$(SignAssembly)' == 'true' " AfterTargets="BeforeBuild">
<ItemGroup>
<OriginalScriptFiles Include="$(MSBuildThisFileDirectory)\tools\Net471\*.ps1" />
</ItemGroup>
<Copy SourceFiles="@(OriginalScriptFiles)" DestinationFolder="$(MSBuildThisFileDirectory)\tools\Net471\signed" SkipUnchangedFiles="true" />
<ItemGroup>
<ScriptFilesToSign Include="$(MSBuildThisFileDirectory)\tools\Net471\signed\*.ps1">
<Authenticode>Microsoft400</Authenticode>
</ScriptFilesToSign>
</ItemGroup>
<SignFiles Files="@(ScriptFilesToSign)" Type="$(SignType)" BinariesDirectory="$(MSBuildThisFileDirectory)\tools\Net471\signed"
IntermediatesDirectory="$(MSBuildThisFileDirectory)\tools\Net471" ESRPSigning="$(ESRPSigning)" UseBearerToken="$(UseBearerToken)" />
</Target>
<Target Name="AfterBuild">
<PropertyGroup>
<OutDir>$(PackageOutputDir)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
</Project>
6 changes: 6 additions & 0 deletions tools/MicrosoftConfigurationBuilders.settings.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<Project DefaultTargets="UnitTest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CustomBeforeProjectTargets>$(MSBuildThisFileDirectory)MicrosoftConfigurationBuilders.Extensions.settings.targets</CustomBeforeProjectTargets>
<RepositoryRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'MicrosoftConfigurationBuilders.sln'))\</RepositoryRoot>
</PropertyGroup>

<Import Project="$(RepositoryRoot)\packages\microbuild.core.0.3.0\build\MicroBuild.Core.props"
Condition="Exists('$(RepositoryRoot)\packages\microbuild.core.0.3.0\build\MicroBuild.Core.props')" />
<Import Project="$(RepositoryRoot)\packages\microbuild.core.0.3.0\build\MicroBuild.Core.targets"
Condition="Exists('$(RepositoryRoot)\packages\microbuild.core.0.3.0\build\MicroBuild.Core.targets')" />
<Import Project="$(CustomBeforeProjectTargets)" Condition="Exists('$(CustomBeforeProjectTargets)')" Label="Pre-targets Build Extensibility Point"/>

<!-- Configurable properties-->
Expand Down
4 changes: 3 additions & 1 deletion tools/NuGetProj.targets
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,12 @@ GetNuGetProjectOutputs: Reads build-generated files from outputs file.
<Target Name="GetNuGetProjectOutputs">
<PropertyGroup>
<NuGetPackTargetFile>$(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion).nupkg</NuGetPackTargetFile>
<NuGetPackTargetFile Condition="'$(NuGetPackSymbols)' == 'true'">$(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion).symbols.nupkg</NuGetPackTargetFile>
<NuGetSymbolPackTargetFile Condition="'$(NuGetPackSymbols)' == 'true'">$(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion).symbols.nupkg</NuGetSymbolPackTargetFile>
</PropertyGroup>
<ItemGroup>
<NuGetProjectOutput Include="$(NuGetPackTargetFile)" />
<NuGetProjectOutput Include="$(NuGetSymbolPackTargetFile)" Condition="'$(NuGetSymbolPackTargetFile)' != ''" />

<NuGetProjectOutput Include="$(NuGetProjectOutputsFile)" />
</ItemGroup>
</Target>
Expand Down

0 comments on commit 4887033

Please sign in to comment.