summaryrefslogtreecommitdiffstats
path: root/tools/DotNetOpenAuth.targets
blob: 8d0167f770056decf52cddf6460e47732c320211 (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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
	<Import Project="DotNetOpenAuth.Versioning.targets" />
	<Import Project="JavascriptPacker.targets" />

	<PropertyGroup>
		<DefineConstants Condition=" '$(SignAssembly)' == 'true' ">$(DefineConstants);StrongNameSigned</DefineConstants>
		<DefineConstants Condition=" '$(ClrVersion)' == '4' ">$(DefineConstants);CLR4</DefineConstants>
	</PropertyGroup>

	<!-- This forces a build break when Code Contracts are not installed. -->
	<PropertyGroup>
		<CompileDependsOn>$(CompileDependsOn);CheckForCodeContracts</CompileDependsOn>
	</PropertyGroup>
	<Target Name="CheckForCodeContracts">
		<Error Condition=" '$(CodeContractsImported)' != 'true' " Text="This project requires Code Contracts. Please install from: http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx" />
	</Target>

	<!-- This is our multi-targeting aware shadow assembly generator. -->
	<UsingTask AssemblyFile="$(ProjectRoot)\lib\DotNetOpenAuth.BuildTasks.dll" TaskName="Publicize" />
	<PropertyGroup>
		<ResolveReferencesDependsOn>
			$(ResolveReferencesDependsOn);
			CreatePublicAccessors
		</ResolveReferencesDependsOn>
	</PropertyGroup>
	<!-- Remove the built-in shadow generator, since we do it ourselves to avoid bugs in the Microsoft code. -->
	<Target Name="CreatePublicAccessors">
		<PropertyGroup>
			<VSVersionForTargetFramework>v10.0</VSVersionForTargetFramework>
			<VSVersionForTargetFramework Condition=" '$(ClrVersion)' != '4' ">v9.0</VSVersionForTargetFramework>
		</PropertyGroup>
		<Publicize
			Condition=" '%(ReferencePath.Shadow)' == 'true' "
			SkipUnchangedFiles="true"
			MSBuildExtensionsPath="$(MSBuildExtensionsPath)"
			ToolPath="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\$(VSVersionForTargetFramework)\TeamTest"
			Assembly="@(ReferencePath)"
			DelaySign="$(DelaySign)"
			KeyFile="$(PublicKeyFile)">
			<Output TaskParameter="AccessorAssembly" ItemName="ReferencePath" />
		</Publicize>
	</Target>
</Project>