summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--projecttemplates/projecttemplates.proj13
-rw-r--r--samples/tools.proj25
-rw-r--r--src/DotNetOpenAuth/DotNetOpenAuth.csproj4
-rw-r--r--tools/DotNetOpenAuth.props1
-rw-r--r--tools/DotNetOpenAuth.targets49
-rw-r--r--tools/drop.proj13
6 files changed, 77 insertions, 28 deletions
diff --git a/projecttemplates/projecttemplates.proj b/projecttemplates/projecttemplates.proj
index d4d3a56..16b939d 100644
--- a/projecttemplates/projecttemplates.proj
+++ b/projecttemplates/projecttemplates.proj
@@ -34,6 +34,9 @@
</Target>
<Target Name="LayoutProjects">
+ <MSBuild Projects="..\src\$(ProductName)\$(ProductName).csproj" Targets="Sign" BuildInParallel="$(BuildInParallel)">
+ <Output TaskParameter="TargetOutputs" ItemName="SignedProductAssemblies" />
+ </MSBuild>
<ItemGroup>
<TemplateProjects Include="**\*.csproj" Exclude="$(MSBuildThisFile)">
<AfterTokens>$safeprojectname$</AfterTokens>
@@ -45,16 +48,14 @@
</TemplateProjects>
<TemplateProjectsLayout Include="@(TemplateProjects->'$(ProjectTemplatesLayoutPath)%(RecursiveDir)%(FileName)%(Extension)')"/>
- <!-- Add external libraries -->
- <!-- Include the unified, signed version of the library -->
- <ProjectTemplateLibraries Include="$(ILMergeOutputAssembly)" />
- <ProjectTemplateLibraries Include="$(ILMergeOutputAssemblyDirectory)$(ProductName).pdb" />
+ <!-- Add external libraries and their symbols -->
+ <ProjectTemplateLibraries Include="@(SignedProductAssemblies)" />
+ <ProjectTemplateLibraries Include="@(SignedProductAssemblies->'%(SymbolPath)')" />
<ProjectTemplateLibraries Include="$(OutputPath)$(ProductName).xml" />
- <ProjectTemplateLibraries Include="$(OutputPath)$(ProductName).Contracts.dll" />
<!-- ... and log4net -->
<ProjectTemplateLibraries Include="$(ProjectRoot)lib\log4net.dll" />
<ProjectTemplateLibraries Include="$(ProjectRoot)lib\log4net.xml" />
- <ProjectTemplateLibrariesTargets Include="@(ProjectTemplateLibraries->'$(ProjectTemplatesLayoutPath)RelyingPartyLogic\lib\%(FileName)%(Extension)')" />
+ <ProjectTemplateLibrariesTargets Include="@(ProjectTemplateLibraries->'$(ProjectTemplatesLayoutPath)RelyingPartyLogic\lib\%(CultureDir)%(FileName)%(Extension)')" />
<FixupReferenceAssemblies Include="@(ProjectTemplateLibrariesTargets)" Condition="'%(Extension)' == '.dll'" />
<InjectedLibraryItems Include="@(ProjectTemplateLibrariesTargets->'lib\%(FileName)%(Extension)')" />
diff --git a/samples/tools.proj b/samples/tools.proj
index 7d5396b..74f6457 100644
--- a/samples/tools.proj
+++ b/samples/tools.proj
@@ -2,30 +2,29 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/>
- <Target Name="Layout" DependsOnTargets="BuildUnifiedProduct;ResignDelaySignedAssemblies">
+ <Target Name="Layout">
<PropertyGroup>
<ToolsDirectoryNoSlash>$(DropsRoot)$(ProductName)-Tools-$(BuildVersion)</ToolsDirectoryNoSlash>
<ToolsDirectory>$(ToolsDirectoryNoSlash)\</ToolsDirectory>
</PropertyGroup>
<ItemGroup>
- <ToolProjects Include="$(ProjectRoot)Samples\OpenIdOfflineProvider\OpenIdOfflineProvider.csproj" />
+ <ToolProjects Include="$(ProjectRoot)Samples\OpenIdOfflineProvider\OpenIdOfflineProvider.csproj">
+ <Targets>Sign</Targets>
+ </ToolProjects>
</ItemGroup>
- <MSBuild Projects="@(ToolProjects)" BuildInParallel="$(BuildInParallel)" />
+ <MSBuild Projects="@(ToolProjects)" Targets="%(ToolProjects.Targets)" BuildInParallel="$(BuildInParallel)">
+ <Output TaskParameter="TargetOutputs" ItemName="OfflineProvider"/>
+ </MSBuild>
<ItemGroup>
- <OfflineProvider Include="
- $(OutputPath)**\*.dll;
- $(OutputPath)OpenIdOfflineProvider.exe"
- Exclude="
- $(OutputPath)$(ProductName).*;
- $(ILMergeOutputAssembly);
- "/>
+ <!-- Remove the un-unified assembly. -->
+ <OfflineProvider Remove="$(OutputPath)$(SignedSubPath)$(ProductName).dll" />
+ <!-- add the PDBs -->
+ <OfflineProvider Include="@(OfflineProvider->'%(SymbolPath)')" />
<OfflineProviderTargets Include="
- @(OfflineProvider->'$(ToolsDirectory)%(RecursiveDir)%(FileName)%(Extension)')"/>
- <OfflineProvider Include="$(ILMergeOutputAssembly)" />
- <OfflineProviderTargets Include="$(ToolsDirectory)$(ProductName).dll" />
+ @(OfflineProvider->'$(ToolsDirectory)%(CultureDir)%(FileName)%(Extension)')"/>
<AllToolSources Include="@(OfflineProvider)" />
<AllToolTargets Include="@(OfflineProviderTargets)" />
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
index 70b2710..80487fc 100644
--- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj
+++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
@@ -735,6 +735,10 @@ http://opensource.org/licenses/ms-pl.html
$(OutputPath)$(ProductName).Contracts.dll;
" />
</ItemGroup>
+ <PropertyGroup>
+ <!-- Don't sign the non-unified version of the assembly. -->
+ <SuppressTargetPathDelaySignedAssembly>true</SuppressTargetPathDelaySignedAssembly>
+ </PropertyGroup>
<Target Name="BuildUnifiedProduct"
DependsOnTargets="Build"
diff --git a/tools/DotNetOpenAuth.props b/tools/DotNetOpenAuth.props
index 91a5e5e..6815fca 100644
--- a/tools/DotNetOpenAuth.props
+++ b/tools/DotNetOpenAuth.props
@@ -21,6 +21,7 @@
<KeyPairContainer Condition="'$(KeyPairContainer)' == ''">DotNetOpenAuth</KeyPairContainer>
<PublicKeyToken>2780CCD10D57B246</PublicKeyToken>
<DelaySign>true</DelaySign>
+ <SignedSubPath>signed\</SignedSubPath>
<ILMergeOutputAssemblyDirectory>$(OutputPath)unified\</ILMergeOutputAssemblyDirectory>
<ILMergeOutputAssembly>$(ILMergeOutputAssemblyDirectory)$(ProductName).dll</ILMergeOutputAssembly>
diff --git a/tools/DotNetOpenAuth.targets b/tools/DotNetOpenAuth.targets
index 34aa424..cab4413 100644
--- a/tools/DotNetOpenAuth.targets
+++ b/tools/DotNetOpenAuth.targets
@@ -4,13 +4,23 @@
<Import Project="JavascriptPacker.targets" />
<UsingTask AssemblyFile="$(ProjectRoot)lib\MSBuild.Community.Tasks.dll" TaskName="ILMerge"/>
+ <!-- Prevent our own item types from appearing in Solution Explorer. -->
+ <ItemDefinitionGroup>
+ <SignDependsOn>
+ <Visible>false</Visible>
+ </SignDependsOn>
+ <DelaySignedAssemblies>
+ <Visible>false</Visible>
+ </DelaySignedAssemblies>
+ </ItemDefinitionGroup>
+
<PropertyGroup>
<DefineConstants Condition=" '$(SignAssembly)' == 'true' ">$(DefineConstants);StrongNameSigned</DefineConstants>
<DefineConstants Condition=" '$(ClrVersion)' == '4' ">$(DefineConstants);CLR4</DefineConstants>
</PropertyGroup>
<ItemGroup>
- <DelaySignedAssemblies Include="$(TargetPath)" />
+ <DelaySignedAssemblies Include="$(TargetPath)" Condition=" '$(SuppressTargetPathDelaySignedAssembly)' != 'true' "/>
</ItemGroup>
<ItemGroup Condition=" '$(ClrVersion)' != '4' ">
@@ -54,23 +64,48 @@
</Publicize>
</Target>
- <Target Name="Sign" DependsOnTargets="@(SignDependsOn)" Condition=" '@(DelaySignedAssemblies)' != '' ">
+ <Target Name="Sign" DependsOnTargets="@(SignDependsOn)" Outputs="@(SignedDependencies);@(SignedAssemblyTargets)" Condition=" '@(DelaySignedAssemblies)' != '' ">
+ <!-- Make sure that all dependencies are also signed. -->
+ <MSBuild Projects="@(ProjectReference)" Targets="Sign" BuildInParallel="$(BuildInParallel)">
+ <Output TaskParameter="TargetOutputs" ItemName="SignedDependencies"/>
+ </MSBuild>
+
<!-- Add the resource assemblies. -->
+ <ItemGroup>
+ <!-- Make sure that we consider the TargetPath's satellites even if TargetPath itself was suppressed. -->
+ <DelaySignedAssembliesForSatellites Include="@(DelaySignedAssemblies)" />
+ <DelaySignedAssembliesForSatellites Include="$(TargetPath)" Condition=" '$(SuppressTargetPathDelaySignedAssembly)' == 'true' "/>
+ </ItemGroup>
<PropertyGroup>
- <DelaySignedSatelliteAssembliesPattern>@(DelaySignedAssemblies->'%(RootDir)%(Directory)*\%(FileName).resources.*')</DelaySignedSatelliteAssembliesPattern>
+ <DelaySignedSatelliteAssembliesPattern>@(DelaySignedAssembliesForSatellites->'%(RootDir)%(Directory)*\%(FileName).resources.*')</DelaySignedSatelliteAssembliesPattern>
</PropertyGroup>
<ItemGroup>
<DelaySignedSatelliteAssemblies Include="$(DelaySignedSatelliteAssembliesPattern)" />
+ <DelaySignedSatelliteAssemblies>
+ <CultureDir>$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('%(Directory)'))))\</CultureDir>
+ </DelaySignedSatelliteAssemblies>
+ </ItemGroup>
+
+ <!-- Don't sign assemblies in place. Lots of reasons for this, not the least of which is that
+ subsequent builds of web site projects will cause the satellite assemblies to be regenerated (bizarre)
+ and erase the signature. -->
+ <ItemGroup>
+ <AssembliesToSign Include="@(DelaySignedAssemblies);@(DelaySignedSatelliteAssemblies)" />
+ <SignedAssemblyTargets Include="@(AssembliesToSign->'%(RootDir)%(Directory)$(SignedSubPath)%(FileName)%(Extension)')">
+ <UnsignedAssemblyPath>%(AssembliesToSign.Identity)</UnsignedAssemblyPath>
+ <SymbolPath Condition="Exists('%(RootDir)%(Directory)%(FileName).pdb')">%(RootDir)%(Directory)%(FileName).pdb</SymbolPath>
+ </SignedAssemblyTargets>
</ItemGroup>
<Message Text="Signing delay-signed assemblies using key pair container $(KeyPairContainer)." />
+ <Copy SourceFiles="@(AssembliesToSign)" DestinationFiles="@(SignedAssemblyTargets)" />
<ReSignDelaySignedAssemblies
KeyContainer="$(KeyPairContainer)"
- Assemblies="@(DelaySignedAssemblies);@(DelaySignedSatelliteAssemblies)"
+ Assemblies="@(SignedAssemblyTargets)"
Condition="Exists(%(Identity))" />
</Target>
- <Target Name="ResignDelaySignedAssemblies">
+ <Target Name="ResignDelaySignedAssemblies" Outputs="@(ResignedAssembliesOutputs)">
<ItemGroup>
<DelaySignedProjects Include="
$(ProjectRoot)src\dotnetopenauth\dotnetopenauth.csproj;
@@ -78,6 +113,8 @@
$(ProjectRoot)samples\openidofflineprovider\openidofflineprovider.csproj;
" />
</ItemGroup>
- <MSBuild Projects="@(DelaySignedProjects)" Targets="Sign" BuildInParallel="$(BuildInParallel)" />
+ <MSBuild Projects="@(DelaySignedProjects)" Targets="Sign" BuildInParallel="$(BuildInParallel)">
+ <Output TaskParameter="TargetOutputs" ItemName="ResignedAssembliesOutputs"/>
+ </MSBuild>
</Target>
</Project>
diff --git a/tools/drop.proj b/tools/drop.proj
index 143d3b5..02fdd20 100644
--- a/tools/drop.proj
+++ b/tools/drop.proj
@@ -41,13 +41,16 @@
"
Exclude="$(ProjectRoot)Doc\README.*.html;" />
<DropBinSourceFiles Include="
- $(ILMergeOutputAssemblyDirectory)$(ProductName).???;
- $(OutputPath)**\$(ProductName).resources.dll;
+ $(ILMergeOutputAssemblyDirectory)$(SignedSubPath)$(ProductName).???;
$(OutputPath)$(ProductName).xml;
- $(OutputPath)$(ProductName).Contracts.???;
+ $(OutputPath)$(SignedSubPath)$(ProductName).Contracts.???;
$(ProjectRoot)Doc\README.Bin.html;
$(ProjectRoot)src\$(ProductName)\Configuration\$(ProductName).xsd;
" />
+ <DropSatelliteSourceFiles Include="$(OutputPath)**\$(SignedSubPath)$(ProductName).resources.dll" />
+ <DropSatelliteSourceFiles>
+ <CultureDir>$([System.IO.Path]::GetDirectoryName('$([System.IO.Path]::GetDirectoryName('%(RecursiveDir)'))'))\</CultureDir>
+ </DropSatelliteSourceFiles>
<DropLibSourceFiles Include="
$(ProjectRoot)Lib\log4net.*;
" />
@@ -66,6 +69,7 @@
$(ProjectRoot)**\Settings.StyleCop;
$(ProjectRoot)**\StyleCop.Cache;
$(ProjectRoot)Samples\**\DotNetOpenAuth.???;
+ $(ProjectRoot)Samples\**\DotNetOpenAuth.resources.???;
$(ProjectRoot)Samples\**\log4net.???;
$(ProjectRoot)Samples\**\PresentationCore.dll;
$(ProjectRoot)Samples\**\System.Printing.dll;
@@ -78,6 +82,7 @@
<DropFiles Include="@(DropSourceFiles->'$(DropDirectory)%(RecursiveDir)%(FileName)%(Extension)')"/>
<DropBinFiles Include="@(DropBinSourceFiles->'$(DropBinDirectory)%(RecursiveDir)%(FileName)%(Extension)')"/>
+ <DropSatelliteFiles Include="@(DropSatelliteSourceFiles->'$(DropBinDirectory)%(CultureDir)%(FileName)%(Extension)')" />
<DropLibFiles Include="@(DropLibSourceFiles->'$(DropLibDirectory)%(RecursiveDir)%(FileName)%(Extension)')"/>
<DropProjectTemplatesFiles Include="@(DropProjectTemplatesSourceFiles->'$(DropProjectTemplatesDirectory)%(FileName)%(Extension)')" />
<DropVsixFiles Include="@(DropVsixSourceFiles->'$(DropProjectTemplatesDirectory)%(FileName)%(Extension)')" />
@@ -89,6 +94,7 @@
<AllDropSources Include="
@(DropSourceFiles);
@(DropBinSourceFiles);
+ @(DropSatelliteSourceFiles);
@(DropLibSourceFiles);
@(DropProjectTemplatesSourceFiles);
@(DropVsixSourceFiles);
@@ -101,6 +107,7 @@
<AllDropTargets Include="
@(DropFiles);
@(DropBinFiles);
+ @(DropSatelliteFiles);
@(DropLibFiles);
@(DropProjectTemplatesFiles);
@(DropVsixFiles);