|
38 | 38 | <NoWarn>$(NoWarn);NU1603</NoWarn>
|
39 | 39 | </PropertyGroup>
|
40 | 40 |
|
| 41 | + <!-- Because ReadAllText is slow on osx/linux, try to find shasum and awk --> |
| 42 | + <PropertyGroup> |
| 43 | + <PaketRestoreCachedHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreCachedHasher)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketRestoreCacheFile) | /usr/bin/awk '{ print $1 }'</PaketRestoreCachedHasher> |
| 44 | + <PaketRestoreLockFileHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreLockFileHash)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketLockFilePath) | /usr/bin/awk '{ print $1 }'</PaketRestoreLockFileHasher> |
| 45 | + </PropertyGroup> |
| 46 | + |
| 47 | + <!-- If shasum and awk exist get the hashes --> |
| 48 | + <Exec Condition=" '$(PaketRestoreCachedHasher)' != '' " Command="$(PaketRestoreCachedHasher)" ConsoleToMSBuild='true'> |
| 49 | + <Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" /> |
| 50 | + </Exec> |
| 51 | + <Exec Condition=" '$(PaketRestoreLockFileHasher)' != '' " Command="$(PaketRestoreLockFileHasher)" ConsoleToMSBuild='true'> |
| 52 | + <Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" /> |
| 53 | + </Exec> |
| 54 | + |
41 | 55 | <PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
|
42 |
| - <PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash> |
43 |
| - <PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash> |
| 56 | + <!-- if no hash has been done yet fall back to just reading in the files and comparing them --> |
| 57 | + <PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash> |
| 58 | + <PaketRestoreLockFileHash Condition=" '$(PaketRestoreLockFileHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash> |
44 | 59 | <PaketRestoreRequired>true</PaketRestoreRequired>
|
45 | 60 | <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
|
46 | 61 | <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
|
|
137 | 152 |
|
138 | 153 | <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
|
139 | 154 | <ItemGroup>
|
140 |
| - <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)/*.nuspec"/> |
| 155 | + <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> |
141 | 156 | </ItemGroup>
|
142 | 157 |
|
143 | 158 | <PropertyGroup>
|
144 | 159 | <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
|
145 | 160 | <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
|
146 | 161 | <UseNewPack>false</UseNewPack>
|
147 | 162 | <UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
|
148 |
| - <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)/</AdjustedNuspecOutputPath> |
| 163 | + <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath> |
149 | 164 | <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
|
150 | 165 | </PropertyGroup>
|
151 | 166 |
|
152 | 167 | <ItemGroup>
|
153 |
| - <_NuspecFiles Include="$(AdjustedNuspecOutputPath)*.nuspec"/> |
| 168 | + <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.nuspec"/> |
154 | 169 | </ItemGroup>
|
155 | 170 |
|
156 | 171 | <Exec Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' Condition="@(_NuspecFiles) != ''" />
|
157 | 172 |
|
158 | 173 | <ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
|
159 | 174 | <Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
|
160 |
| - </ConvertToAbsolutePath> |
| 175 | + </ConvertToAbsolutePath> |
| 176 | + |
161 | 177 |
|
162 | 178 | <!-- Call Pack -->
|
163 | 179 | <PackTask Condition="$(UseNewPack)"
|
|
0 commit comments