1+ <?xml  version =" 1.0"  encoding =" utf-8"  ?>
2+ <Project  ToolsVersion =" 4.0"   xmlns =" http://schemas.microsoft.com/developer/msbuild/2003"  >
3+   <PropertyGroup >
4+     <!--  Enable the restore command to run before builds --> 
5+     <RestorePackages  Condition ="  '$(RestorePackages)' == '' "  >true</RestorePackages >
6+     <!--  Download Paket.exe if it does not already exist --> 
7+     <DownloadPaket  Condition ="  '$(DownloadPaket)' == '' "  >true</DownloadPaket >
8+     <PaketToolsPath >$(MSBuildThisFileDirectory)</PaketToolsPath >
9+     <PaketRootPath >$(MSBuildThisFileDirectory)..\</PaketRootPath >
10+   </PropertyGroup >
11+   <PropertyGroup >
12+     <!--  Paket command --> 
13+     <PaketExePath  Condition ="  '$(PaketExePath)' == '' "  >$(PaketToolsPath)paket.exe</PaketExePath >
14+     <PaketBootStrapperExePath  Condition ="  '$(PaketBootStrapperExePath)' == '' "  >$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath >
15+     <PaketCommand  Condition ="  '$(OS)' == 'Windows_NT'"  >"$(PaketExePath)"</PaketCommand >
16+     <PaketCommand  Condition ="  '$(OS)' != 'Windows_NT' "  >mono --runtime=v4.0.30319 $(PaketExePath)</PaketCommand >
17+     <PaketBootStrapperCommand  Condition ="  '$(OS)' == 'Windows_NT'"  >"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand >
18+     <PaketBootStrapperCommand  Condition ="  '$(OS)' != 'Windows_NT' "  >mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand >
19+     <!--  Commands --> 
20+     <PaketReferences >$(MSBuildProjectDirectory)\paket.references</PaketReferences >
21+     <RestoreCommand >$(PaketCommand) restore --references-files $(PaketReferences)</RestoreCommand >
22+     <DownloadPaketCommand >$(PaketBootStrapperCommand)</DownloadPaketCommand >
23+     <!--  We need to ensure packages are restored prior to assembly resolve --> 
24+     <BuildDependsOn  Condition =" $(RestorePackages) == 'true'"  >RestorePackages; $(BuildDependsOn);</BuildDependsOn >
25+   </PropertyGroup >
26+   <Target  Name =" CheckPrerequisites"  >
27+     <!--  Raise an error if we're unable to locate paket.exe --> 
28+     <Error  Condition =" '$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')"   Text =" Unable to locate '$(PaketExePath)'"   />
29+     <MsBuild  Targets =" DownloadPaket"   Projects =" $(MSBuildThisFileFullPath)"   Properties =" Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)"   />
30+   </Target >
31+   <Target  Name =" DownloadPaket"  >
32+     <Exec  Command =" $(DownloadPaketCommand)"   Condition ="  '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')"   />
33+   </Target >
34+   <Target  Name =" RestorePackages"   DependsOnTargets =" CheckPrerequisites"  >
35+     <Exec  Command =" $(RestoreCommand)"   WorkingDirectory =" $(PaketRootPath)"   Condition =" Exists('$(PaketReferences)')"   />
36+   </Target >
37+ </Project >
0 commit comments