|
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 | 20 | <!-- Paket command -->
|
| 21 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketToolsPath)paket')">$(PaketToolsPath)paket</PaketExePath> |
17 | 22 | <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 | 23 |
|
22 |
| - <!-- .net core fdd --> |
23 |
| - <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension> |
24 |
| - <PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand> |
| 24 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' ">$(PaketToolsPath)paket.exe</PaketExePath> |
| 25 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'assembly' ">$(PaketToolsPath)paket.exe</PaketExePath> |
| 26 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'native' ">$(PaketToolsPath)paket</PaketExePath> |
25 | 27 |
|
26 |
| - <!-- no extension is a shell script --> |
27 |
| - <PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand> |
| 28 | + <!-- Paket command --> |
| 29 | + <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension> |
| 30 | + <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand> |
| 31 | + <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand> |
| 32 | + <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand> |
| 33 | + <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT'">"$(PaketExePath)"</PaketCommand> |
28 | 34 |
|
29 | 35 | <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
|
30 | 36 | <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
|
|
38 | 44 | <DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
|
39 | 45 | </PropertyGroup>
|
40 | 46 |
|
41 |
| - <Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" > |
| 47 | + <Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')"> |
| 48 | + <MSBuild Projects="$(PaketToolsPath)paket.bootstrapper.proj" Targets="Restore" /> |
| 49 | + </Target> |
| 50 | + |
| 51 | + <Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" DependsOnTargets="PaketBootstrapping"> |
42 | 52 |
|
43 | 53 | <!-- Step 1 Check if lockfile is properly restored -->
|
44 | 54 | <PropertyGroup>
|
|
77 | 87 | </PropertyGroup>
|
78 | 88 |
|
79 | 89 | <!-- Do a global restore if required -->
|
80 |
| - <Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" /> |
| 90 | + <Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" /> |
81 | 91 | <Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
|
82 | 92 |
|
83 | 93 | <!-- Step 2 Detect project specific changes -->
|
|
141 | 151 |
|
142 | 152 | <ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " >
|
143 | 153 | <PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
|
| 154 | + <Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits> |
144 | 155 | <PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
|
145 | 156 | <PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
|
146 | 157 | <AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
|
| 158 | + <CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal> |
147 | 159 | </PaketReferencesFileLinesInfo>
|
148 | 160 | <PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
|
149 | 161 | <Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
|
150 | 162 | <PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
|
151 |
| - <ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets> |
| 163 | + <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets> |
| 164 | + <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets> |
152 | 165 | <Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
|
153 | 166 | </PackageReference>
|
154 | 167 | </ItemGroup>
|
|
181 | 194 | <Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
|
182 | 195 | <PropertyGroup>
|
183 | 196 | <ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
|
| 197 | + <DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion> |
| 198 | + <DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion> |
184 | 199 | </PropertyGroup>
|
185 | 200 | </Target>
|
186 | 201 |
|
187 | 202 | <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
|
188 | 203 | <ItemGroup>
|
189 | 204 | <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
|
| 205 | + <MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" /> |
| 206 | + <MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" /> |
190 | 207 | </ItemGroup>
|
191 | 208 |
|
192 | 209 | <PropertyGroup>
|
193 | 210 | <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
|
194 | 211 | <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
|
195 |
| - <UseNewPack>false</UseNewPack> |
196 |
| - <UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack> |
| 212 | + <UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack> |
| 213 | + <UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack> |
| 214 | + <UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack> |
| 215 | + <UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack> |
| 216 | + <UseNuGet4_Pack>false</UseNuGet4_Pack> |
| 217 | + <UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack> |
197 | 218 | <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
|
198 | 219 | <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
|
199 | 220 | </PropertyGroup>
|
|
208 | 229 | <Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
|
209 | 230 | </ConvertToAbsolutePath>
|
210 | 231 |
|
211 |
| - |
212 | 232 | <!-- Call Pack -->
|
213 |
| - <PackTask Condition="$(UseNewPack)" |
| 233 | + <PackTask Condition="$(UseMSBuild15_9_Pack)" |
| 234 | + PackItem="$(PackProjectInputFile)" |
| 235 | + PackageFiles="@(_PackageFiles)" |
| 236 | + PackageFilesToExclude="@(_PackageFilesToExclude)" |
| 237 | + PackageVersion="$(PackageVersion)" |
| 238 | + PackageId="$(PackageId)" |
| 239 | + Title="$(Title)" |
| 240 | + Authors="$(Authors)" |
| 241 | + Description="$(Description)" |
| 242 | + Copyright="$(Copyright)" |
| 243 | + RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)" |
| 244 | + LicenseUrl="$(PackageLicenseUrl)" |
| 245 | + ProjectUrl="$(PackageProjectUrl)" |
| 246 | + IconUrl="$(PackageIconUrl)" |
| 247 | + ReleaseNotes="$(PackageReleaseNotes)" |
| 248 | + Tags="$(PackageTags)" |
| 249 | + DevelopmentDependency="$(DevelopmentDependency)" |
| 250 | + BuildOutputInPackage="@(_BuildOutputInPackage)" |
| 251 | + TargetPathsToSymbols="@(_TargetPathsToSymbols)" |
| 252 | + SymbolPackageFormat="symbols.nupkg" |
| 253 | + TargetFrameworks="@(_TargetFrameworks)" |
| 254 | + AssemblyName="$(AssemblyName)" |
| 255 | + PackageOutputPath="$(PackageOutputAbsolutePath)" |
| 256 | + IncludeSymbols="$(IncludeSymbols)" |
| 257 | + IncludeSource="$(IncludeSource)" |
| 258 | + PackageTypes="$(PackageType)" |
| 259 | + IsTool="$(IsTool)" |
| 260 | + RepositoryUrl="$(RepositoryUrl)" |
| 261 | + RepositoryType="$(RepositoryType)" |
| 262 | + SourceFiles="@(_SourceFiles->Distinct())" |
| 263 | + NoPackageAnalysis="$(NoPackageAnalysis)" |
| 264 | + MinClientVersion="$(MinClientVersion)" |
| 265 | + Serviceable="$(Serviceable)" |
| 266 | + FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)" |
| 267 | + ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)" |
| 268 | + NuspecOutputPath="$(AdjustedNuspecOutputPath)" |
| 269 | + IncludeBuildOutput="$(IncludeBuildOutput)" |
| 270 | + BuildOutputFolder="$(BuildOutputTargetFolder)" |
| 271 | + ContentTargetFolders="$(ContentTargetFolders)" |
| 272 | + RestoreOutputPath="$(RestoreOutputAbsolutePath)" |
| 273 | + NuspecFile="$(NuspecFileAbsolutePath)" |
| 274 | + NuspecBasePath="$(NuspecBasePath)" |
| 275 | + NuspecProperties="$(NuspecProperties)"/> |
| 276 | + |
| 277 | + <PackTask Condition="$(UseMSBuild15_8_Pack)" |
214 | 278 | PackItem="$(PackProjectInputFile)"
|
215 | 279 | PackageFiles="@(_PackageFiles)"
|
216 | 280 | PackageFilesToExclude="@(_PackageFilesToExclude)"
|
|
253 | 317 | NuspecBasePath="$(NuspecBasePath)"
|
254 | 318 | NuspecProperties="$(NuspecProperties)"/>
|
255 | 319 |
|
256 |
| - <PackTask Condition="! $(UseNewPack)" |
| 320 | + <PackTask Condition="$(UseNuGet4_Pack)" |
257 | 321 | PackItem="$(PackProjectInputFile)"
|
258 | 322 | PackageFiles="@(_PackageFiles)"
|
259 | 323 | PackageFilesToExclude="@(_PackageFilesToExclude)"
|
|
0 commit comments