summaryrefslogtreecommitdiffstats
path: root/nuget/nuget.proj
blob: ceca8f04a89691c7b97a96f3684d01a3390f7578 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
	<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " />
	<Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/>

	<Target Name="BuildIntermediates">
		<ItemGroup>
			<ProductTargets Include="BuildUnifiedProduct;ReSignDelaySignedAssemblies" />
		</ItemGroup>

		<!-- We build the entire unified, signed product targeting both CLRs, since NuGet supports packages that contain both,
		     and by building against CLR 4, several assembly references fall away from dotnetopenauth.dll, which makes some folks happy. -->
		<MSBuild
			Projects="$(ProjectRoot)src\DotNetOpenAuth\DotNetOpenAuth.proj"
			Targets="@(ProductTargets)"
			Properties="TargetFrameworkVersion=v3.5"
			BuildInParallel="$(BuildInParallel)">
			<Output TaskParameter="TargetOutputs" ItemName="ResignedAssembliesOutputs35"/>
		</MSBuild>
		<MSBuild
			Projects="$(ProjectRoot)src\DotNetOpenAuth\DotNetOpenAuth.proj"
			Targets="@(ProductTargets)"
			Properties="TargetFrameworkVersion=v4.0"
			BuildInParallel="$(BuildInParallel)">
			<Output TaskParameter="TargetOutputs" ItemName="ResignedAssembliesOutputs40"/>
		</MSBuild>

		<ItemGroup>
			<ResignedAssembliesOutputs Include="@(ResignedAssembliesOutputs35)" Condition=" '%(MSBuildSourceTargetName)' == 'Sign' ">
				<TargetFramework>v3.5</TargetFramework>
			</ResignedAssembliesOutputs>
			<ResignedAssembliesOutputs Include="@(ResignedAssembliesOutputs40)" Condition=" '%(MSBuildSourceTargetName)' == 'Sign' ">
				<TargetFramework>v4.0</TargetFramework>
			</ResignedAssembliesOutputs>
		</ItemGroup>
	</Target>

	<Target Name="Layout" DependsOnTargets="BuildIntermediates">
		<PropertyGroup>
			<NuGetLayoutPath>$(DropsRoot)NuGet\$(BuildVersion)\</NuGetLayoutPath>
		</PropertyGroup>

		<MSBuild Projects="$(ProjectRoot)src\DotNetOpenAuth\DotNetOpenAuth.proj" Targets="DocumentationProjectOutputGroup" BuildInParallel="$(BuildInParallel)">
			<Output TaskParameter="TargetOutputs" ItemName="NuGetSource"/>
		</MSBuild>

		<!-- IMPORTANT: These must appear as separate ItemGroups or else batching screws it up. -->
		<ItemGroup>
			<NuGetSource Include="%(ResignedAssembliesOutputs.Identity)" Condition=" '%(FileName)%(Extension)' == 'DotNetOpenAuth.dll' ">
				<TargetPath Condition=" '%(TargetFramework)' == 'v4.0' ">$(NuGetLayoutPath)lib\net40-full\%(FileName)%(Extension)</TargetPath>
				<TargetPath Condition=" '%(TargetFramework)' == 'v3.5' ">$(NuGetLayoutPath)lib\net35-full\%(FileName)%(Extension)</TargetPath>
			</NuGetSource>
		</ItemGroup>
		<ItemGroup>
			<NuGetContentSource Include="$(ProjectRoot)NuGet\content\**"/>
		</ItemGroup>
		<ItemGroup>
			<NuGetSource Include="@(NuGetContentSource)">
				<TargetPath>$(NuGetLayoutPath)content\%(RecursiveDir)%(FileName)%(Extension)</TargetPath>
			</NuGetSource>

			<NuSpecSource Include="DotNetOpenAuth.Ultimate.nuspec">
				<LayoutPath>$(NuGetLayoutPath)</LayoutPath>
				<BeforeTokens>$version$</BeforeTokens>
				<AfterTokens>$(BuildVersion)</AfterTokens>
			</NuSpecSource>

			<NuSpecTarget Include="@(NuSpecSource->'$(NuGetLayoutPath)%(FileName)%(Extension)')" />
		</ItemGroup>
		<ItemGroup>
			<NuGetContentsTarget Include="%(NuGetSource.TargetPath)" />
		</ItemGroup>

		<CopyWithTokenSubstitution
			SourceFiles="@(NuSpecSource)"
			DestinationFiles="@(NuSpecTarget)"
			/>

		<Copy
			SourceFiles="@(NuGetSource)"
			DestinationFiles="@(NuGetContentsTarget)"
			SkipUnchangedFiles="true" />

		<Purge Directories="$(NuGetLayoutPath)" IntendedFiles="@(NuGetContentsTarget);@(NuSpecTarget)" />
	</Target>

	<Target Name="Build" DependsOnTargets="Layout">
		<NuGetPack
			NuSpec="%(NuSpecTarget.Identity)"
			BaseDirectory="%(NuSpecTarget.LayoutPath)"
			OutputPackageDirectory="$(DropsRoot)"
			ToolPath="$(NuGetToolPath)" />
	</Target>

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