summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-02-18 22:23:32 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-02-18 22:23:32 -0800
commit48fd92dd1dacfc0b8e5ee301ea61097b0accfe0f (patch)
treea75093940bd4649458d9f38a5f9c6005a362c2cf /tools
parent0d0918b7f40353c473f0b213d2279ae99de6384f (diff)
downloadDotNetOpenAuth-48fd92dd1dacfc0b8e5ee301ea61097b0accfe0f.zip
DotNetOpenAuth-48fd92dd1dacfc0b8e5ee301ea61097b0accfe0f.tar.gz
DotNetOpenAuth-48fd92dd1dacfc0b8e5ee301ea61097b0accfe0f.tar.bz2
Fixed issue of unsigned satellite assemblies in drop .zip.
Diffstat (limited to 'tools')
-rw-r--r--tools/DotNetOpenAuth.props1
-rw-r--r--tools/DotNetOpenAuth.targets49
-rw-r--r--tools/drop.proj13
3 files changed, 54 insertions, 9 deletions
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);