annotate SilverlightAsyncRestWcf/.nuget/NuGet.targets @ 118:fa4ba8943048

final version
author stevenh7776
date Sun, 27 May 2012 19:53:23 +0100
parents
children
rev   line source
118
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
1 <?xml version="1.0" encoding="utf-8"?>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
2 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
3 <PropertyGroup>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
4 <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
5
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
6 <!-- Windows specific commands -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
7 <NuGetToolsPath Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
8 <PackagesConfig Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
9 <PackagesDir Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
10
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
11 <!-- We need to launch nuget.exe with the mono command if we're not on windows -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
12 <NuGetToolsPath Condition=" '$(OS)' != 'Windows_NT'">$(SolutionDir).nuget</NuGetToolsPath>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
13 <PackagesConfig Condition=" '$(OS)' != 'Windows_NT' ">packages.config</PackagesConfig>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
14 <PackagesDir Condition=" '$(OS)' != 'Windows_NT'">$(SolutionDir)packages</PackagesDir>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
15
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
16 <!-- NuGet command -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
17 <NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
18 <NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
19 <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
20
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
21 <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
22
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
23 <!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
24 <PackageSources>""</PackageSources>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
25
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
26 <!-- Enable the restore command to run before builds -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
27 <RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
28
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
29 <!-- Property that enables building a package from a project -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
30 <BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
31
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
32 <!-- Commands -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
33 <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)"</RestoreCommand>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
34 <BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
35
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
36 <!-- Make the build depend on restore packages -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
37 <BuildDependsOn Condition="$(RestorePackages) == 'true'">
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
38 RestorePackages;
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
39 $(BuildDependsOn);
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
40 </BuildDependsOn>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
41
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
42 <!-- Make the build depend on restore packages -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
43 <BuildDependsOn Condition="$(BuildPackage) == 'true'">
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
44 $(BuildDependsOn);
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
45 BuildPackage;
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
46 </BuildDependsOn>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
47 </PropertyGroup>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
48
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
49 <Target Name="CheckPrerequisites">
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
50 <!-- Raise an error if we're unable to locate nuget.exe -->
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
51 <Error Condition="!Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
52 </Target>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
53
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
54 <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
55 <Exec Command="$(RestoreCommand)"
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
56 Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
57
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
58 <Exec Command="$(RestoreCommand)"
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
59 LogStandardErrorAsError="true"
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
60 Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
61 </Target>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
62
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
63 <Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
64 <Exec Command="$(BuildCommand)"
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
65 Condition=" '$(OS)' != 'Windows_NT' " />
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
66
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
67 <Exec Command="$(BuildCommand)"
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
68 LogStandardErrorAsError="true"
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
69 Condition=" '$(OS)' == 'Windows_NT' " />
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
70 </Target>
fa4ba8943048 final version
stevenh7776
parents:
diff changeset
71 </Project>