|
18 | 18 | <PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
|
19 | 19 | <PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
|
20 | 20 | <PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
|
| 21 | + |
| 22 | + <!-- .net core fdd --> |
| 23 | + <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension> |
| 24 | + <PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand> |
| 25 | + |
| 26 | + <!-- no extension is a shell script --> |
| 27 | + <PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand> |
| 28 | + |
21 | 29 | <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
|
22 | 30 | <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
|
23 | 31 | <PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
|
|
30 | 38 | <DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
|
31 | 39 | </PropertyGroup>
|
32 | 40 |
|
33 |
| - <Target Name="PaketRestore" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" > |
| 41 | + <Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" > |
34 | 42 |
|
35 | 43 | <!-- Step 1 Check if lockfile is properly restored -->
|
36 | 44 | <PropertyGroup>
|
37 | 45 | <PaketRestoreRequired>true</PaketRestoreRequired>
|
38 | 46 | <NoWarn>$(NoWarn);NU1603</NoWarn>
|
39 | 47 | </PropertyGroup>
|
40 | 48 |
|
| 49 | + <!-- Because ReadAllText is slow on osx/linux, try to find shasum and awk --> |
| 50 | + <PropertyGroup> |
| 51 | + <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> |
| 52 | + <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> |
| 53 | + </PropertyGroup> |
| 54 | + |
| 55 | + <!-- If shasum and awk exist get the hashes --> |
| 56 | + <Exec Condition=" '$(PaketRestoreCachedHasher)' != '' " Command="$(PaketRestoreCachedHasher)" ConsoleToMSBuild='true'> |
| 57 | + <Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" /> |
| 58 | + </Exec> |
| 59 | + <Exec Condition=" '$(PaketRestoreLockFileHasher)' != '' " Command="$(PaketRestoreLockFileHasher)" ConsoleToMSBuild='true'> |
| 60 | + <Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" /> |
| 61 | + </Exec> |
| 62 | + |
41 | 63 | <PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
|
42 |
| - <PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash> |
43 |
| - <PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash> |
| 64 | + <!-- if no hash has been done yet fall back to just reading in the files and comparing them --> |
| 65 | + <PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash> |
| 66 | + <PaketRestoreLockFileHash Condition=" '$(PaketRestoreLockFileHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash> |
44 | 67 | <PaketRestoreRequired>true</PaketRestoreRequired>
|
45 | 68 | <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
|
46 | 69 | <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
|
|
88 | 111 | <Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)"' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
|
89 | 112 |
|
90 | 113 | <!-- This shouldn't actually happen, but just to be sure. -->
|
91 |
| - <Error Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' " Text="A paket file for the framework '$(TargetFramework)' is missing. Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." /> |
| 114 | + <Error Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' AND '$(ResolveNuGetPackages)' != 'False' " Text="Paket file '$(PaketResolvedFilePath)' is missing while restoring $(MSBuildProjectFile). Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." /> |
92 | 115 |
|
93 | 116 | <!-- Step 4 forward all msbuild properties (PackageReference, DotNetCliToolReference) to msbuild -->
|
94 | 117 | <ReadLinesFromFile Condition="Exists('$(PaketResolvedFilePath)')" File="$(PaketResolvedFilePath)" >
|
|
99 | 122 | <PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
|
100 | 123 | <PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
|
101 | 124 | <PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
|
| 125 | + <AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets> |
102 | 126 | </PaketReferencesFileLinesInfo>
|
103 | 127 | <PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
|
104 | 128 | <Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
|
| 129 | + <PrivateAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'true'">All</PrivateAssets> |
105 | 130 | </PackageReference>
|
106 | 131 | </ItemGroup>
|
107 | 132 |
|
|
123 | 148 | </DotNetCliToolReference>
|
124 | 149 | </ItemGroup>
|
125 | 150 |
|
| 151 | + <!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964 |
126 | 152 | <PropertyGroup>
|
127 | 153 | <RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
|
128 |
| - </PropertyGroup> |
| 154 | + </PropertyGroup> --> |
129 | 155 |
|
130 | 156 | </Target>
|
131 | 157 |
|
|
136 | 162 | </Target>
|
137 | 163 |
|
138 | 164 | <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
|
| 165 | + <ItemGroup> |
| 166 | + <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> |
| 167 | + </ItemGroup> |
| 168 | + |
139 | 169 | <PropertyGroup>
|
140 | 170 | <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
|
141 | 171 | <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
|
142 | 172 | <UseNewPack>false</UseNewPack>
|
143 | 173 | <UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
|
| 174 | + <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath> |
| 175 | + <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath> |
144 | 176 | </PropertyGroup>
|
145 | 177 |
|
146 | 178 | <ItemGroup>
|
147 |
| - <_NuspecFiles Include="$(BaseIntermediateOutputPath)*.nuspec"/> |
| 179 | + <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.nuspec"/> |
148 | 180 | </ItemGroup>
|
149 | 181 |
|
150 | 182 | <Exec Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' Condition="@(_NuspecFiles) != ''" />
|
151 | 183 |
|
152 | 184 | <ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
|
153 | 185 | <Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
|
154 |
| - </ConvertToAbsolutePath> |
| 186 | + </ConvertToAbsolutePath> |
| 187 | + |
155 | 188 |
|
156 | 189 | <!-- Call Pack -->
|
157 | 190 | <PackTask Condition="$(UseNewPack)"
|
|
188 | 221 | Serviceable="$(Serviceable)"
|
189 | 222 | FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
|
190 | 223 | ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
|
191 |
| - NuspecOutputPath="$(BaseIntermediateOutputPath)" |
| 224 | + NuspecOutputPath="$(AdjustedNuspecOutputPath)" |
192 | 225 | IncludeBuildOutput="$(IncludeBuildOutput)"
|
193 | 226 | BuildOutputFolder="$(BuildOutputTargetFolder)"
|
194 | 227 | ContentTargetFolders="$(ContentTargetFolders)"
|
|
230 | 263 | Serviceable="$(Serviceable)"
|
231 | 264 | AssemblyReferences="@(_References)"
|
232 | 265 | ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
|
233 |
| - NuspecOutputPath="$(BaseIntermediateOutputPath)" |
| 266 | + NuspecOutputPath="$(AdjustedNuspecOutputPath)" |
234 | 267 | IncludeBuildOutput="$(IncludeBuildOutput)"
|
235 | 268 | BuildOutputFolder="$(BuildOutputTargetFolder)"
|
236 | 269 | ContentTargetFolders="$(ContentTargetFolders)"
|
|
0 commit comments