summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth/DotNetOpenAuth.proj
blob: 61aa259583343d3294a0ed2424266a4880e9862a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="BuildUnifiedProduct">
	<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " />

	<PropertyGroup>
		<SuppressBuildTarget>true</SuppressBuildTarget>
		<AddContractsAssemblyForDelaySigning>false</AddContractsAssemblyForDelaySigning>
	</PropertyGroup>

	<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.props" />
	<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.Product.props" />

	<UsingTask AssemblyFile="$(ProjectRoot)lib\MSBuild.Community.Tasks.dll" TaskName="ILMerge"/>

	<PropertyGroup>
		<TargetPath>$(ILMergeOutputAssembly)</TargetPath>
	</PropertyGroup>

	<ItemGroup>
		<ProjectReference Include="@(ProductProjects)">
			<PrimaryProductOutput>true</PrimaryProductOutput>
		</ProjectReference>
		<SignDependsOn Include="BuildUnifiedProduct" />
		<DelaySignedAssemblies Include="$(ILMergeOutputContractAssembly)" />
	</ItemGroup>

	<Target Name="BuildILMergeInputs" DependsOnTargets="ResolveReferences">
		<PropertyGroup>
			<!-- The ILMerge task doesn't properly quote the path. -->
			<ILMergeTargetPlatformDirectory Condition=" '$(ClrVersion)' == '4' ">"$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"</ILMergeTargetPlatformDirectory>
		</PropertyGroup>

		<ItemGroup>
			<ILMergeInputAssemblies Include="@(ReferencePath)"
															Condition=" '%(ReferencePath.PrimaryProductOutput)' == 'true' "/>
			<ILMergeInputContractAssemblies Include="@(ILMergeInputAssemblies->'%(RootDir)%(Directory)CodeContracts\%(FileName).Contracts%(Extension)')"
																			Condition=" '%(FileName)' != 'Microsoft.Contracts' "/>
		</ItemGroup>
	</Target>

	<Target Name="BuildUnifiedContractAssembly"	 DependsOnTargets="BuildILMergeInputs"
					Inputs="@(ILMergeInputContractAssemblies)" Outputs="$(ILMergeOutputContractAssembly)">

		<MakeDir Directories="$(ILMergeOutputContractAssemblyDirectory)" />

		<ILMerge
			ExcludeFile="$(ProjectRoot)ILMergeInternalizeExceptions.txt"
			InputAssemblies="@(ILMergeInputContractAssemblies)"
			OutputFile="$(ILMergeOutputContractAssembly)"
			SearchDirectories="$(OutputPath)"
			KeyFile="$(PublicKeyFile)"
			DelaySign="true"
			ToolPath="$(ProjectRoot)tools\ILMerge"
			TargetPlatformVersion="$(ClrVersion).0"
			TargetPlatformDirectory="$(ILMergeTargetPlatformDirectory)" />
	</Target>

	<Target Name="BuildUnifiedProductAssembly" DependsOnTargets="BuildILMergeInputs"
					Inputs="@(ILMergeInputAssemblies)" Outputs="$(ILMergeOutputAssembly)">
		<MakeDir Directories="$(ILMergeOutputAssemblyDirectory)" />

		<ILMerge
			ExcludeFile="$(ProjectRoot)ILMergeInternalizeExceptions.txt"
			InputAssemblies="@(ILMergeInputAssemblies)"
			OutputFile="$(ILMergeOutputAssembly)"
			KeyFile="$(PublicKeyFile)"
			DelaySign="true"
			ToolPath="$(ProjectRoot)tools\ILMerge"
			TargetPlatformVersion="$(ClrVersion).0"
			TargetPlatformDirectory="$(ILMergeTargetPlatformDirectory)" />
	</Target>

	<Target Name="BuildUnifiedProduct" DependsOnTargets="BuildUnifiedProductAssembly;BuildUnifiedContractAssembly" />

	<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
	<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" />
	<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " />
</Project>