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

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