|
11 | 11 | <PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath> |
12 | 12 | <PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile> |
13 | 13 | <PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath> |
| 14 | + <PaketBootstrapperStyle>classic</PaketBootstrapperStyle> |
| 15 | + <PaketBootstrapperStyle Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">proj</PaketBootstrapperStyle> |
| 16 | + <PaketExeImage>assembly</PaketExeImage> |
| 17 | + <PaketExeImage Condition=" '$(PaketBootstrapperStyle)' == 'proj' ">native</PaketExeImage> |
14 | 18 | <MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath> |
15 | 19 | <MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath> |
16 | | - <!-- Paket command --> |
17 | | - <PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath> |
18 | | - <PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath> |
19 | | - <PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand> |
20 | | - <PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand> |
21 | 20 |
|
22 | | - <!-- .net core fdd --> |
| 21 | + <!-- PaketBootStrapper --> |
| 22 | + <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath> |
| 23 | + <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath> |
| 24 | + <PaketBootStrapperExeDir Condition=" Exists('$(PaketBootStrapperExePath)') " >$([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\</PaketBootStrapperExeDir> |
| 25 | + |
| 26 | + <!-- Paket --> |
| 27 | + |
| 28 | + <!-- windows, root => tool => proj style => bootstrapper => global --> |
| 29 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketRootPath)paket.exe') ">$(PaketRootPath)paket.exe</PaketExePath> |
| 30 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketToolsPath)paket.exe') ">$(PaketToolsPath)paket.exe</PaketExePath> |
| 31 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND '$(PaketBootstrapperStyle)' == 'proj' ">$(PaketToolsPath)paket.exe</PaketExePath> |
| 32 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketBootStrapperExeDir)') ">$(_PaketBootStrapperExeDir)paket.exe</PaketExePath> |
| 33 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' ">paket.exe</PaketExePath> |
| 34 | + |
| 35 | + <!-- no windows, try native paket as default, root => tool => proj style => mono paket => bootstrpper => global --> |
| 36 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketRootPath)paket') ">$(PaketRootPath)paket</PaketExePath> |
| 37 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketToolsPath)paket') ">$(PaketToolsPath)paket</PaketExePath> |
| 38 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketBootstrapperStyle)' == 'proj' ">$(PaketToolsPath)paket</PaketExePath> |
| 39 | + |
| 40 | + <!-- no windows, try mono paket --> |
| 41 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketRootPath)paket.exe') ">$(PaketRootPath)paket.exe</PaketExePath> |
| 42 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketToolsPath)paket.exe') ">$(PaketToolsPath)paket.exe</PaketExePath> |
| 43 | + |
| 44 | + <!-- no windows, try bootstrapper --> |
| 45 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketBootStrapperExeDir)') ">$(PaketBootStrapperExeDir)paket.exe</PaketExePath> |
| 46 | + |
| 47 | + <!-- no windows, try global native paket --> |
| 48 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' ">paket</PaketExePath> |
| 49 | + |
| 50 | + <!-- Paket command --> |
23 | 51 | <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension> |
24 | | - <PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand> |
| 52 | + <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand> |
| 53 | + <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand> |
| 54 | + <PaketCommand Condition=" '$(PaketCommand)' == '' ">"$(PaketExePath)"</PaketCommand> |
25 | 55 |
|
26 | | - <!-- no extension is a shell script --> |
27 | | - <PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand> |
28 | 56 |
|
29 | | - <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath> |
30 | | - <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath> |
31 | 57 | <PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand> |
32 | 58 | <PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand> |
33 | 59 |
|
|
36 | 62 | <!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md --> |
37 | 63 | <DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference> |
38 | 64 | <DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference> |
| 65 | + |
| 66 | + <!-- Disable Paket restore under NCrunch build --> |
| 67 | + <PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled> |
39 | 68 | </PropertyGroup> |
40 | 69 |
|
41 | | - <Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" > |
| 70 | + <Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')"> |
| 71 | + <MSBuild Projects="$(PaketToolsPath)paket.bootstrapper.proj" Targets="Restore" /> |
| 72 | + </Target> |
| 73 | + |
| 74 | + <Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" DependsOnTargets="PaketBootstrapping"> |
42 | 75 |
|
43 | 76 | <!-- Step 1 Check if lockfile is properly restored --> |
44 | 77 | <PropertyGroup> |
|
72 | 105 | <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired> |
73 | 106 | </PropertyGroup> |
74 | 107 |
|
75 | | - <PropertyGroup Condition="'$(PaketPropsVersion)' != '5.174.2' "> |
| 108 | + <!-- |
| 109 | + This value should match the version in the props generated by paket |
| 110 | + If they differ, this means we need to do a restore in order to ensure correct dependencies |
| 111 | + --> |
| 112 | + <PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' "> |
76 | 113 | <PaketRestoreRequired>true</PaketRestoreRequired> |
77 | 114 | </PropertyGroup> |
78 | 115 |
|
79 | 116 | <!-- Do a global restore if required --> |
80 | | - <Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" /> |
| 117 | + <Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" /> |
81 | 118 | <Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" /> |
82 | 119 |
|
83 | 120 | <!-- Step 2 Detect project specific changes --> |
|
141 | 178 |
|
142 | 179 | <ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " > |
143 | 180 | <PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" > |
| 181 | + <Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits> |
144 | 182 | <PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName> |
145 | 183 | <PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion> |
146 | 184 | <AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets> |
| 185 | + <CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal> |
147 | 186 | </PaketReferencesFileLinesInfo> |
148 | 187 | <PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)"> |
149 | 188 | <Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version> |
150 | 189 | <PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets> |
151 | | - <ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets> |
| 190 | + <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets> |
| 191 | + <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets> |
152 | 192 | <Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish> |
| 193 | + <AllowExplicitVersion>true</AllowExplicitVersion> |
153 | 194 | </PackageReference> |
154 | 195 | </ItemGroup> |
155 | 196 |
|
|
181 | 222 | <Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
182 | 223 | <PropertyGroup> |
183 | 224 | <ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec> |
| 225 | + <DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion> |
| 226 | + <DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion> |
184 | 227 | </PropertyGroup> |
185 | 228 | </Target> |
186 | 229 |
|
187 | 230 | <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
188 | 231 | <ItemGroup> |
189 | 232 | <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> |
| 233 | + <MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" /> |
| 234 | + <MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" /> |
190 | 235 | </ItemGroup> |
191 | 236 |
|
192 | 237 | <PropertyGroup> |
193 | 238 | <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile> |
194 | 239 | <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec> |
195 | | - <UseNewPack>false</UseNewPack> |
196 | | - <UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack> |
| 240 | + <UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack> |
| 241 | + <UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack> |
| 242 | + <UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack> |
| 243 | + <UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack> |
| 244 | + <UseNuGet4_Pack>false</UseNuGet4_Pack> |
| 245 | + <UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack> |
197 | 246 | <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath> |
198 | 247 | <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath> |
199 | 248 | </PropertyGroup> |
|
208 | 257 | <Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" /> |
209 | 258 | </ConvertToAbsolutePath> |
210 | 259 |
|
211 | | - |
212 | 260 | <!-- Call Pack --> |
213 | | - <PackTask Condition="$(UseNewPack)" |
| 261 | + <PackTask Condition="$(UseMSBuild15_9_Pack)" |
| 262 | + PackItem="$(PackProjectInputFile)" |
| 263 | + PackageFiles="@(_PackageFiles)" |
| 264 | + PackageFilesToExclude="@(_PackageFilesToExclude)" |
| 265 | + PackageVersion="$(PackageVersion)" |
| 266 | + PackageId="$(PackageId)" |
| 267 | + Title="$(Title)" |
| 268 | + Authors="$(Authors)" |
| 269 | + Description="$(Description)" |
| 270 | + Copyright="$(Copyright)" |
| 271 | + RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)" |
| 272 | + LicenseUrl="$(PackageLicenseUrl)" |
| 273 | + ProjectUrl="$(PackageProjectUrl)" |
| 274 | + IconUrl="$(PackageIconUrl)" |
| 275 | + ReleaseNotes="$(PackageReleaseNotes)" |
| 276 | + Tags="$(PackageTags)" |
| 277 | + DevelopmentDependency="$(DevelopmentDependency)" |
| 278 | + BuildOutputInPackage="@(_BuildOutputInPackage)" |
| 279 | + TargetPathsToSymbols="@(_TargetPathsToSymbols)" |
| 280 | + SymbolPackageFormat="symbols.nupkg" |
| 281 | + TargetFrameworks="@(_TargetFrameworks)" |
| 282 | + AssemblyName="$(AssemblyName)" |
| 283 | + PackageOutputPath="$(PackageOutputAbsolutePath)" |
| 284 | + IncludeSymbols="$(IncludeSymbols)" |
| 285 | + IncludeSource="$(IncludeSource)" |
| 286 | + PackageTypes="$(PackageType)" |
| 287 | + IsTool="$(IsTool)" |
| 288 | + RepositoryUrl="$(RepositoryUrl)" |
| 289 | + RepositoryType="$(RepositoryType)" |
| 290 | + SourceFiles="@(_SourceFiles->Distinct())" |
| 291 | + NoPackageAnalysis="$(NoPackageAnalysis)" |
| 292 | + MinClientVersion="$(MinClientVersion)" |
| 293 | + Serviceable="$(Serviceable)" |
| 294 | + FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)" |
| 295 | + ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)" |
| 296 | + NuspecOutputPath="$(AdjustedNuspecOutputPath)" |
| 297 | + IncludeBuildOutput="$(IncludeBuildOutput)" |
| 298 | + BuildOutputFolder="$(BuildOutputTargetFolder)" |
| 299 | + ContentTargetFolders="$(ContentTargetFolders)" |
| 300 | + RestoreOutputPath="$(RestoreOutputAbsolutePath)" |
| 301 | + NuspecFile="$(NuspecFileAbsolutePath)" |
| 302 | + NuspecBasePath="$(NuspecBasePath)" |
| 303 | + NuspecProperties="$(NuspecProperties)"/> |
| 304 | + |
| 305 | + <PackTask Condition="$(UseMSBuild15_8_Pack)" |
214 | 306 | PackItem="$(PackProjectInputFile)" |
215 | 307 | PackageFiles="@(_PackageFiles)" |
216 | 308 | PackageFilesToExclude="@(_PackageFilesToExclude)" |
|
253 | 345 | NuspecBasePath="$(NuspecBasePath)" |
254 | 346 | NuspecProperties="$(NuspecProperties)"/> |
255 | 347 |
|
256 | | - <PackTask Condition="! $(UseNewPack)" |
| 348 | + <PackTask Condition="$(UseNuGet4_Pack)" |
257 | 349 | PackItem="$(PackProjectInputFile)" |
258 | 350 | PackageFiles="@(_PackageFiles)" |
259 | 351 | PackageFilesToExclude="@(_PackageFilesToExclude)" |
|
0 commit comments