|
21 | 21 | <PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketToolsPath)paket')">$(PaketToolsPath)paket</PaketExePath> |
22 | 22 | <PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath> |
23 | 23 |
|
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> |
| 24 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketToolsPath)paket.exe')">$(PaketToolsPath)paket.exe</PaketExePath> |
| 25 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'assembly' AND Exists('$(PaketToolsPath)paket.exe') ">$(PaketToolsPath)paket.exe</PaketExePath> |
| 26 | + <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'native' AND Exists('$(PaketToolsPath)paket') ">$(PaketToolsPath)paket</PaketExePath> |
| 27 | + <PaketExePath Condition=" '$(PaketExePath)' == '' ">paket</PaketExePath> |
27 | 28 |
|
28 | 29 | <!-- Paket command --> |
29 | 30 | <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension> |
30 | 31 | <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand> |
31 | | - <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand> |
32 | 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> |
| 33 | + <PaketCommand Condition=" '$(PaketCommand)' == '' ">"$(PaketExePath)"</PaketCommand> |
34 | 34 |
|
35 | 35 | <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath> |
36 | 36 | <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath> |
|
151 | 151 |
|
152 | 152 | <ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " > |
153 | 153 | <PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" > |
| 154 | + <Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits> |
154 | 155 | <PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName> |
155 | 156 | <PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion> |
156 | 157 | <AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets> |
157 | | - <CopyLocal>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal> |
| 158 | + <CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal> |
158 | 159 | </PaketReferencesFileLinesInfo> |
159 | 160 | <PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)"> |
160 | 161 | <Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version> |
161 | 162 | <PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets> |
162 | | - <ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">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> |
163 | 165 | <Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish> |
164 | 166 | </PackageReference> |
165 | 167 | </ItemGroup> |
|
192 | 194 | <Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
193 | 195 | <PropertyGroup> |
194 | 196 | <ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec> |
| 197 | + <DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion> |
| 198 | + <DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion> |
195 | 199 | </PropertyGroup> |
196 | 200 | </Target> |
197 | 201 |
|
198 | 202 | <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
199 | 203 | <ItemGroup> |
200 | 204 | <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> |
| 205 | + <MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" /> |
| 206 | + <MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" /> |
201 | 207 | </ItemGroup> |
202 | 208 |
|
203 | 209 | <PropertyGroup> |
204 | 210 | <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile> |
205 | 211 | <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec> |
206 | | - <UseNewPack>false</UseNewPack> |
207 | | - <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> |
208 | 218 | <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath> |
209 | 219 | <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath> |
210 | 220 | </PropertyGroup> |
|
219 | 229 | <Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" /> |
220 | 230 | </ConvertToAbsolutePath> |
221 | 231 |
|
222 | | - |
223 | 232 | <!-- Call Pack --> |
224 | | - <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)" |
225 | 278 | PackItem="$(PackProjectInputFile)" |
226 | 279 | PackageFiles="@(_PackageFiles)" |
227 | 280 | PackageFilesToExclude="@(_PackageFilesToExclude)" |
|
264 | 317 | NuspecBasePath="$(NuspecBasePath)" |
265 | 318 | NuspecProperties="$(NuspecProperties)"/> |
266 | 319 |
|
267 | | - <PackTask Condition="! $(UseNewPack)" |
| 320 | + <PackTask Condition="$(UseNuGet4_Pack)" |
268 | 321 | PackItem="$(PackProjectInputFile)" |
269 | 322 | PackageFiles="@(_PackageFiles)" |
270 | 323 | PackageFilesToExclude="@(_PackageFilesToExclude)" |
|
0 commit comments