annotate Stocks/.nuget/NuGet.targets @ 66:b41cd0075c35

Third count added
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sun, 22 Apr 2012 16:00:41 +0100
parents c812bca7b1ac
children
rev   line source
6
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
1 <?xml version="1.0" encoding="utf-8"?>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
2 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
3 <PropertyGroup>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
4 <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
5 <NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
6 <NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
7 <PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
8 <PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
9 <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
10
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
11 <!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
12 <PackageSources>""</PackageSources>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
13
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
14 <!-- Enable the restore command to run before builds -->
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
15 <RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
16
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
17 <!-- Property that enables building a package from a project -->
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
18 <BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
19
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
20 <!-- Commands -->
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
21 <RestoreCommand>"$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)"</RestoreCommand>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
22 <BuildCommand>"$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
23
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
24 <!-- Make the build depend on restore packages -->
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
25 <BuildDependsOn Condition="$(RestorePackages) == 'true'">
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
26 RestorePackages;
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
27 $(BuildDependsOn);
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
28 </BuildDependsOn>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
29
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
30 <!-- Make the build depend on restore packages -->
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
31 <BuildDependsOn Condition="$(BuildPackage) == 'true'">
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
32 $(BuildDependsOn);
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
33 BuildPackage;
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
34 </BuildDependsOn>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
35 </PropertyGroup>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
36
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
37 <Target Name="CheckPrerequisites">
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
38 <!-- Raise an error if we're unable to locate nuget.exe -->
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
39 <Error Condition="!Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
40 </Target>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
41
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
42 <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
43 <Exec Command="$(RestoreCommand)"
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
44 LogStandardErrorAsError="true"
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
45 Condition="Exists('$(PackagesConfig)')" />
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
46 </Target>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
47
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
48 <Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
49 <Exec Command="$(BuildCommand)"
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
50 LogStandardErrorAsError="true" />
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
51 </Target>
c812bca7b1ac "Restore packages on build" enabled by Nuget 1.6
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
52 </Project>