annotate SSRS/.nuget/NuGet.targets @ 112:b9d5f934cb21

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