Skip to content

Commit 5344e0e

Browse files
author
Liudmila Molkova
authored
Enable code signing (#33)
1 parent 675f794 commit 5344e0e

15 files changed

+203
-40
lines changed

Microsoft.AspNet.TelemetryCorrelation.msbuild

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2-
<Import Project="tools\Microsoft.AspNet.TelemetryCorrelation.settings.targets"/>
3-
42
<ItemGroup>
53
<AssemblyProject Include="src\Microsoft.AspNet.TelemetryCorrelation\Microsoft.AspNet.TelemetryCorrelation.csproj" />
64
</ItemGroup>
7-
<ItemGroup>
8-
<AssemblyProject Include="test\Microsoft.AspNet.TelemetryCorrelation.Tests\Microsoft.AspNet.TelemetryCorrelation.Tests.csproj" />
9-
</ItemGroup>
105

116
<ItemGroup>
127
<PackageProject Include="src\Packages\Packages.csproj" />
138
</ItemGroup>
149

15-
<!-- Composite targets -->
16-
<Target Name="BuildCI" DependsOnTargets="Clean;Build" />
17-
1810
<Target Name="Build" DependsOnTargets="BuildAssemblies;BuildPackages" />
1911
<Target Name="Clean" DependsOnTargets="CleanPackages;CleanAssemblies" />
2012
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />

src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<FileAlignment>512</FileAlignment>
1515
<SignAssembly>true</SignAssembly>
1616
<DelaySign>true</DelaySign>
17-
<AssemblyOriginatorKeyFile>..\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
17+
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
1818
<SccProjectName>SAK</SccProjectName>
1919
<SccLocalPath>SAK</SccLocalPath>
2020
<SccAuxPath>SAK</SccAuxPath>
@@ -27,6 +27,7 @@
2727
</NuGetPackageImportStamp>
2828
</PropertyGroup>
2929
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
30+
<DebugSymbols>true</DebugSymbols>
3031
<DebugType>full</DebugType>
3132
<Optimize>false</Optimize>
3233
<DefineConstants>DEBUG;TRACE</DefineConstants>
@@ -68,9 +69,10 @@
6869
</ItemGroup>
6970
<ItemGroup>
7071
<None Include="Microsoft.AspNet.TelemetryCorrelation.ruleset" />
71-
<None Include="packages.config">
72-
<SubType>Designer</SubType>
73-
</None>
72+
<None Include="packages.config"/>
73+
</ItemGroup>
74+
<ItemGroup>
75+
<None Include="35MSSharedLib1024.snk" />
7476
</ItemGroup>
7577
<ItemGroup>
7678
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
@@ -79,10 +81,25 @@
7981
</ItemGroup>
8082
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
8183
<Import Project="..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets" Condition="Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets')" />
84+
85+
8286
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
8387
<PropertyGroup>
8488
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
8589
</PropertyGroup>
8690
<Error Condition="!Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets'))" />
91+
<Error Condition="!Exists('..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.props'))" />
92+
<Error Condition="!Exists('..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets'))" />
93+
</Target>
94+
<Import Project="..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets" Condition="Exists('..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets')" />
95+
<Target Name="AddToSign" AfterTargets="AfterBuild">
96+
<ItemGroup>
97+
<FilesToSign Include="$(TargetPath)" Condition="'$(SignAssembly)' == 'true'">
98+
<Authenticode>Microsoft</Authenticode>
99+
<StrongName>MsSharedLib72</StrongName>
100+
</FilesToSign>
101+
</ItemGroup>
102+
103+
<Message Text="FilesToSign: %(FilesToSign.Identity); %(FilesToSign.Authenticode); %(FilesToSign.StrongName)" Importance="high"/>
87104
</Target>
88105
</Project>

src/Microsoft.AspNet.TelemetryCorrelation/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="MicroBuild.Core" version="0.3.0" targetFramework="net45" developmentDependency="true" />
34
<package id="Microsoft.Diagnostics.Tracing.EventRegister" version="1.1.28" targetFramework="net45" />
45
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
56
<package id="System.Diagnostics.DiagnosticSource" version="4.4.0" targetFramework="net45" />

src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuproj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
66
<NuGetPackageId>$(MSBuildProjectName)</NuGetPackageId>
77
<NuSpecFile>$(MSBuildProjectName).nuspec</NuSpecFile>
8+
<IsPackage>true</IsPackage>
89
</PropertyGroup>
910
<ItemGroup>
1011
<NuGetContent Include="$(AssemblyName).dll">
@@ -24,5 +25,15 @@
2425
<Destination>content\net45</Destination>
2526
</NuGetContent>
2627
</ItemGroup>
27-
<Import Project="$(RepositoryRoot)Tools\NuGetProj.targets"/>
28+
<Import Project="$(RepositoryRoot)tools\NuGetProj.targets"/>
29+
<Target Name="AfterBuild">
30+
<PropertyGroup>
31+
<OutDir>$(PackageOutputDir)</OutDir>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
35+
<Authenticode>NuGet</Authenticode>
36+
</FilesToSign>
37+
</ItemGroup>
38+
</Target>
2839
</Project>

src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<package>
1+
<?xml version="1.0"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
33
<metadata>
44
<id>$NuGetPackageId$</id>
55
<title>Microsoft.AspNet.TelemetryCorrelation</title>
Binary file not shown.

test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<SignAssembly>true</SignAssembly>
3838
</PropertyGroup>
3939
<PropertyGroup>
40-
<AssemblyOriginatorKeyFile>35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
40+
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
4141
</PropertyGroup>
4242
<PropertyGroup>
4343
<DelaySign>true</DelaySign>
@@ -103,20 +103,16 @@
103103
<Link>Resources\web.config.uninstall.xdt</Link>
104104
</EmbeddedResource>
105105
</ItemGroup>
106+
<ItemGroup>
107+
<None Include="35MSSharedLib1024.snk" />
108+
</ItemGroup>
106109
<ItemGroup>
107110
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
108111
</ItemGroup>
109112
<ItemGroup>
110113
<Analyzer Include="..\..\packages\xunit.analyzers.0.7.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
111114
</ItemGroup>
112115
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
113-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
114-
Other similar extension points exist, see Microsoft.Common.targets.
115-
<Target Name="BeforeBuild">
116-
</Target>
117-
<Target Name="AfterBuild">
118-
</Target>
119-
-->
120116
<UsingTask AssemblyFile="$(OutputPath)xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit" />
121117
<Target Name="AfterBuild">
122118
<xunit Assemblies="$(OutputPath)Microsoft.AspNet.TelemetryCorrelation.Tests.dll" />
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
3+
<PropertyGroup>
4+
<RepositoryRootEx Condition="'$(RepositoryRootEx)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\</RepositoryRootEx>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
9+
<BinPath>$(RepositoryRootEx)bin\</BinPath>
10+
<ObjPath>$(RepositoryRootEx)obj\</ObjPath>
11+
<OutputPath>$(BinPath)$(Configuration)\</OutputPath>
12+
<IntermediateOutputPath>$(ObjPath)$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<AssemblyPath Condition="'$(CodeSignEnabled)' == 'true'">$(CodeSignOutputPath)</AssemblyPath>
17+
<AssemblyPath Condition="'$(AssemblyPath)' == ''">$(OutputPath)</AssemblyPath>
18+
</PropertyGroup>
19+
20+
<PropertyGroup>
21+
<CustomAfterProjectTargets>$(MSBuildThisFileDirectory)Microsoft.AspNet.TelemetryCorrelation.Extensions.targets</CustomAfterProjectTargets>
22+
</PropertyGroup>
23+
</Project>

tools/Microsoft.AspNet.TelemetryCorrelation.Extensions.targets

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,5 @@
55
<NuGetPackageVersion Condition="'$(UpdateNightlyPackages)' == 'true'">$(NuGetPackageVersion)-b$(VersionBuild)</NuGetPackageVersion>
66
</PropertyGroup>
77

8-
<ItemGroup>
9-
<NuGetInstallScripts Include="$(RepositoryRootEx)src\Packages\Microsoft.AspNet.TelemetryCorrelation\tools\*.ps1"/>
10-
</ItemGroup>
118

12-
<Target Name="CopyInstallScripts">
13-
<Copy SourceFiles="@(NuGetInstallScripts)"
14-
DestinationFolder="$(AssemblyPath)"
15-
/>
16-
</Target>
17-
189
</Project>

0 commit comments

Comments
 (0)