summaryrefslogtreecommitdiffstats
path: root/nuget/nuget.proj
blob: 4d79d1f9ecc082ef370a1fa79ab116fb5d2484d8 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
<?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;ResignShippingDelaySignedAssemblies" Condition=" '$(SkipNugetDependenciesBuild)' != 'true' " />
			<ProductTargets Include="GetOutputPath" />
			<AspNetTargets Include="Build;Sign" Condition=" '$(SkipNugetDependenciesBuild)' != 'true' " />
			<AspNetTargets Include="GetOutputPath" />
		</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="TargetOutputs35"/>
		</MSBuild>
		<MSBuild
			Projects="$(ProjectRoot)src\DotNetOpenAuth\DotNetOpenAuth.proj"
			Targets="@(ProductTargets)"
			Properties="TargetFrameworkVersion=v4.0"
			BuildInParallel="$(BuildInParallel)">
			<Output TaskParameter="TargetOutputs" ItemName="TargetOutputs40"/>
		</MSBuild>
		<MSBuild
			Projects="$(ProjectRoot)src\DotNetOpenAuth\DotNetOpenAuth.proj"
			Targets="@(ProductTargets)"
			Properties="TargetFrameworkVersion=v4.5"
			BuildInParallel="$(BuildInParallel)">
			<Output TaskParameter="TargetOutputs" ItemName="TargetOutputs45"/>
		</MSBuild>
		<MSBuild
			Projects="$(ProjectRoot)src\DotNetOpenAuth.AspNet\DotNetOpenAuth.AspNet.csproj"
			Targets="@(AspNetTargets)"
			Properties="TargetFrameworkVersion=v4.0"
			BuildInParallel="$(BuildInParallel)">
		</MSBuild>
		<MSBuild
			Projects="$(ProjectRoot)src\DotNetOpenAuth.AspNet\DotNetOpenAuth.AspNet.csproj"
			Targets="@(AspNetTargets)"
			Properties="TargetFrameworkVersion=v4.5"
			BuildInParallel="$(BuildInParallel)">
		</MSBuild>

		<ItemGroup>
			<ResignedAssembliesOutputs Include="@(TargetOutputs35)" Condition=" '%(MSBuildSourceTargetName)' == 'Sign' ">
				<TargetFramework>v3.5</TargetFramework>
			</ResignedAssembliesOutputs>
			<ResignedAssembliesOutputs Include="@(TargetOutputs40)" Condition=" '%(MSBuildSourceTargetName)' == 'Sign' ">
				<TargetFramework>v4.0</TargetFramework>
			</ResignedAssembliesOutputs>
			<ResignedAssembliesOutputs Include="@(TargetOutputs45)" Condition=" '%(MSBuildSourceTargetName)' == 'Sign' ">
				<TargetFramework>v4.5</TargetFramework>
			</ResignedAssembliesOutputs>
		</ItemGroup>
		<PropertyGroup>
			<OutputPath35 Condition=" '%(MSBuildSourceTargetName)' == 'GetOutputPath' ">@(TargetOutputs35)</OutputPath35>
			<OutputPath40 Condition=" '%(MSBuildSourceTargetName)' == 'GetOutputPath' ">@(TargetOutputs40)</OutputPath40>
			<OutputPath45 Condition=" '%(MSBuildSourceTargetName)' == 'GetOutputPath' ">@(TargetOutputs45)</OutputPath45>
		</PropertyGroup>
	</Target>

	<Target Name="Build" DependsOnTargets="BuildIntermediates" Returns="@(NuGetPackages)">
		<ItemGroup>
			<NuGetProperties Include="version=$(NuGetPackageVersion)" />
			<NuGetProperties Include="oauth2version=$(OAuth2PackagesVersion)" />
			<NuGetProperties Include="OutputPath35=$(OutputPath35)" />
			<NuGetProperties Include="OutputPath40=$(OutputPath40)" />
			<NuGetProperties Include="OutputPath45=$(OutputPath45)" />
			<NuGetProperties Include="IntermediatePath=$(IntermediatePath40)" />

			<NuGetSpecifications Include="*.nuspec" Exclude="*oauth2*.nuspec;DotNetOpenAuth.nuspec">
				<Symbols>true</Symbols>
				<PackageVersion>$(NuGetPackageVersion)</PackageVersion>
			</NuGetSpecifications>
			<NuGetSpecifications Include="*oauth2*.nuspec" Exclude="DotNetOpenAuth.nuspec">
				<Symbols>true</Symbols>
				<PackageVersion>$(OAuth2PackagesVersion)</PackageVersion>
			</NuGetSpecifications>
			<NuGetSpecifications Include="DotNetOpenAuth.nuspec">
				<PackageVersion>$(NuGetPackageVersion)</PackageVersion>
			</NuGetSpecifications>

			<NuGetPackages Include="@(NuGetSpecifications->'$(DropsRoot)%(FileName).%(PackageVersion).nupkg')" />
		</ItemGroup>
		<PropertyGroup>
			<_NuGetProperties>@(NuGetProperties)</_NuGetProperties>
		</PropertyGroup>
		<ItemGroup>
			<NuGetSpecifications>
				<Properties>$(_NuGetProperties);Identity=%(FileName);GeneratedAssemblyInfoSourceFile=$(IntermediatePath40)%(FileName).Version.cs</Properties>
			</NuGetSpecifications>
		</ItemGroup>

		<NuGetPack
			NuSpec="%(NuGetSpecifications.Identity)"
			OutputPackageDirectory="$(DropsRoot)"
			Properties="%(NuGetSpecifications.Properties)"
			Symbols="%(NuGetSpecifications.Symbols)"
			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>