|
| 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 | + <RestoreCommand>$(PaketCommand) restore</RestoreCommand> |
| 21 | + <DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand> |
| 22 | + <!-- We need to ensure packages are restored prior to assembly resolve --> |
| 23 | + <BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn> |
| 24 | + </PropertyGroup> |
| 25 | + <Target Name="CheckPrerequisites"> |
| 26 | + <!-- Raise an error if we're unable to locate paket.exe --> |
| 27 | + <Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" /> |
| 28 | + <MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" /> |
| 29 | + </Target> |
| 30 | + <Target Name="DownloadPaket"> |
| 31 | + <Exec Command="$(DownloadPaketCommand)" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" /> |
| 32 | + </Target> |
| 33 | + <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites"> |
| 34 | + <Exec Command="$(RestoreCommand)" WorkingDirectory="$(PaketRootPath)" /> |
| 35 | + </Target> |
| 36 | +</Project> |
0 commit comments