|
141 | 141 |
|
142 | 142 | <ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " > |
143 | 143 | <PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" > |
| 144 | + <Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits> |
144 | 145 | <PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName> |
145 | 146 | <PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion> |
146 | 147 | <AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets> |
147 | | - <CopyLocal>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal> |
| 148 | + <CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal> |
148 | 149 | </PaketReferencesFileLinesInfo> |
149 | 150 | <PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)"> |
150 | 151 | <Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version> |
151 | 152 | <PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets> |
152 | | - <ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets> |
| 153 | + <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets> |
| 154 | + <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets> |
153 | 155 | <Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish> |
154 | 156 | </PackageReference> |
155 | 157 | </ItemGroup> |
|
182 | 184 | <Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
183 | 185 | <PropertyGroup> |
184 | 186 | <ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec> |
| 187 | + <DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion> |
| 188 | + <DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion> |
185 | 189 | </PropertyGroup> |
186 | 190 | </Target> |
187 | 191 |
|
188 | 192 | <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
189 | 193 | <ItemGroup> |
190 | 194 | <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> |
| 195 | + <MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" /> |
| 196 | + <MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" /> |
191 | 197 | </ItemGroup> |
192 | 198 |
|
193 | 199 | <PropertyGroup> |
194 | 200 | <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile> |
195 | 201 | <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec> |
196 | | - <UseNewPack>false</UseNewPack> |
197 | | - <UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack> |
| 202 | + <UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack> |
| 203 | + <UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack> |
| 204 | + <UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack> |
| 205 | + <UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack> |
| 206 | + <UseNuGet4_Pack>false</UseNuGet4_Pack> |
| 207 | + <UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack> |
198 | 208 | <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath> |
199 | 209 | <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath> |
200 | 210 | </PropertyGroup> |
|
209 | 219 | <Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" /> |
210 | 220 | </ConvertToAbsolutePath> |
211 | 221 |
|
212 | | - |
213 | 222 | <!-- Call Pack --> |
214 | | - <PackTask Condition="$(UseNewPack)" |
| 223 | + <PackTask Condition="$(UseMSBuild15_9_Pack)" |
| 224 | + PackItem="$(PackProjectInputFile)" |
| 225 | + PackageFiles="@(_PackageFiles)" |
| 226 | + PackageFilesToExclude="@(_PackageFilesToExclude)" |
| 227 | + PackageVersion="$(PackageVersion)" |
| 228 | + PackageId="$(PackageId)" |
| 229 | + Title="$(Title)" |
| 230 | + Authors="$(Authors)" |
| 231 | + Description="$(Description)" |
| 232 | + Copyright="$(Copyright)" |
| 233 | + RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)" |
| 234 | + LicenseUrl="$(PackageLicenseUrl)" |
| 235 | + ProjectUrl="$(PackageProjectUrl)" |
| 236 | + IconUrl="$(PackageIconUrl)" |
| 237 | + ReleaseNotes="$(PackageReleaseNotes)" |
| 238 | + Tags="$(PackageTags)" |
| 239 | + DevelopmentDependency="$(DevelopmentDependency)" |
| 240 | + BuildOutputInPackage="@(_BuildOutputInPackage)" |
| 241 | + TargetPathsToSymbols="@(_TargetPathsToSymbols)" |
| 242 | + SymbolPackageFormat="symbols.nupkg" |
| 243 | + TargetFrameworks="@(_TargetFrameworks)" |
| 244 | + AssemblyName="$(AssemblyName)" |
| 245 | + PackageOutputPath="$(PackageOutputAbsolutePath)" |
| 246 | + IncludeSymbols="$(IncludeSymbols)" |
| 247 | + IncludeSource="$(IncludeSource)" |
| 248 | + PackageTypes="$(PackageType)" |
| 249 | + IsTool="$(IsTool)" |
| 250 | + RepositoryUrl="$(RepositoryUrl)" |
| 251 | + RepositoryType="$(RepositoryType)" |
| 252 | + SourceFiles="@(_SourceFiles->Distinct())" |
| 253 | + NoPackageAnalysis="$(NoPackageAnalysis)" |
| 254 | + MinClientVersion="$(MinClientVersion)" |
| 255 | + Serviceable="$(Serviceable)" |
| 256 | + FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)" |
| 257 | + ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)" |
| 258 | + NuspecOutputPath="$(AdjustedNuspecOutputPath)" |
| 259 | + IncludeBuildOutput="$(IncludeBuildOutput)" |
| 260 | + BuildOutputFolder="$(BuildOutputTargetFolder)" |
| 261 | + ContentTargetFolders="$(ContentTargetFolders)" |
| 262 | + RestoreOutputPath="$(RestoreOutputAbsolutePath)" |
| 263 | + NuspecFile="$(NuspecFileAbsolutePath)" |
| 264 | + NuspecBasePath="$(NuspecBasePath)" |
| 265 | + NuspecProperties="$(NuspecProperties)"/> |
| 266 | + |
| 267 | + <PackTask Condition="$(UseMSBuild15_8_Pack)" |
215 | 268 | PackItem="$(PackProjectInputFile)" |
216 | 269 | PackageFiles="@(_PackageFiles)" |
217 | 270 | PackageFilesToExclude="@(_PackageFilesToExclude)" |
|
254 | 307 | NuspecBasePath="$(NuspecBasePath)" |
255 | 308 | NuspecProperties="$(NuspecProperties)"/> |
256 | 309 |
|
257 | | - <PackTask Condition="! $(UseNewPack)" |
| 310 | + <PackTask Condition="$(UseNuGet4_Pack)" |
258 | 311 | PackItem="$(PackProjectInputFile)" |
259 | 312 | PackageFiles="@(_PackageFiles)" |
260 | 313 | PackageFilesToExclude="@(_PackageFilesToExclude)" |
|
0 commit comments