|
11 | 11 | <UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="ReadNuGetPackageInfos" />
|
12 | 12 | <UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="RemoveInternetSourcesFromNuGetConfig" />
|
13 | 13 | <UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="UpdateJson" />
|
| 14 | + <UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="ValidateUsageAgainstBaseline" /> |
14 | 15 | <UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="WriteBuildOutputProps" />
|
15 | 16 | <UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="WritePackageUsageData" />
|
16 | 17 | <UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="WriteRestoreSourceProps" />
|
|
166 | 167 | OutputPath="$(PackageVersionPropsPath)" />
|
167 | 168 |
|
168 | 169 | <WriteBuildOutputProps NuGetPackages="@(_PreviouslySourceBuiltPackages)"
|
| 170 | + IncludeCreationTimeProperty="true" |
169 | 171 | OutputPath="$(PackageVersionPropsPath).pre.$(RepositoryName).xml" />
|
170 | 172 |
|
171 | 173 | <ReadLinesFromFile File="$(PackageVersionPropsPath)">
|
|
191 | 193 | Condition="'@(ConflictingPackageInfos)' != ''">
|
192 | 194 | <PropertyGroup>
|
193 | 195 | <_ReportDir>$(ConflictingPackageReportDir)before-$(RepositoryName)/</_ReportDir>
|
194 |
| - <_ReportDataFile>$(_ReportDir)usage.json</_ReportDataFile> |
| 196 | + <_ReportDataFile>$(_ReportDir)usage.xml</_ReportDataFile> |
195 | 197 | </PropertyGroup>
|
196 | 198 |
|
197 | 199 | <WritePackageUsageData NuGetPackageInfos="@(ConflictingPackageInfos)"
|
198 |
| - ProjectDirectories="@(ProjectDirectories)" |
| 200 | + RootDir="$(ProjectDir)" |
199 | 201 | DataFile="$(_ReportDataFile)" />
|
200 | 202 |
|
201 | 203 | <WriteUsageReports DataFile="$(_ReportDataFile)"
|
|
352 | 354 |
|
353 | 355 | <Target Name="WritePrebuiltUsageData"
|
354 | 356 | DependsOnTargets="GetAllProjectDirectories">
|
| 357 | + <!-- Save the PVP snapshot of each build step to be evaluated while building the report. --> |
355 | 358 | <ItemGroup>
|
356 |
| - <PrebuiltPackages Include="$(PrebuiltPackagesPath)*.nupkg" /> |
357 |
| - <PrebuiltPackages Include="$(TarballPrebuiltPackagesPath)*.nupkg" Condition="'$(TarballPrebuiltPackagesPath)' != ''"/> |
| 359 | + <PackageVersionPropsSnapshotFiles Include="$(IntermediatePath)PackageVersions.props.pre.*.xml" /> |
| 360 | + </ItemGroup> |
| 361 | + <Copy SourceFiles="@(PackageVersionPropsSnapshotFiles)" DestinationFolder="$(PackageReportDir)snapshots/" /> |
358 | 362 |
|
359 |
| - <PackageVersionPropsSnapshotSourceFiles Include="$(IntermediatePath)PackageVersions.props.pre.*.xml" /> |
| 363 | + <ItemGroup> |
| 364 | + <AllRestoredPackageFiles Include="$(LocalNuGetPackagesRoot)**/*.nupkg" /> |
| 365 | + <AllRestoredPackageFiles Include="$(PackagesDir)**/*.nupkg" /> |
360 | 366 |
|
361 |
| - <ProjectDirectories Include="$(ToolsDir);$(TaskDirectory);$(BaseIntermediatePath)" /> |
362 |
| - <!-- Scan the entire project, in case project.assets.json ends up in an unexpected place. --> |
363 |
| - <ProjectDirectories Include="$(ProjectDir)" /> |
364 |
| - </ItemGroup> |
| 367 | + <!-- Only contains packages when building a tarball. --> |
| 368 | + <TarballPrebuiltPackageFiles Include="$(PrebuiltPackagesPath)*.nupkg" /> |
365 | 369 |
|
366 |
| - <Copy SourceFiles="@(PackageVersionPropsSnapshotSourceFiles)" DestinationFolder="$(PackageReportDir)" /> |
| 370 | + <SourceBuiltPackageFiles Include="$(SourceBuiltBlobFeedDir)**/*.nupkg" /> |
367 | 371 |
|
368 |
| - <Message Importance="High" Text="Reading prebuilt nupkg identities..." /> |
| 372 | + <!-- Check all RIDs from all restored Microsoft.NETCore.Platforms packages. --> |
| 373 | + <PlatformsRuntimeJsonFiles Include="$(LocalNuGetPackagesRoot)*/microsoft.netcore.platforms/*/runtime.json" /> |
| 374 | + <PlatformsRuntimeJsonFiles Include="$(PackagesDir)microsoft.netcore.platforms/*/runtime.json" /> |
369 | 375 |
|
370 |
| - <ReadNuGetPackageInfos PackagePaths="@(PrebuiltPackages)"> |
371 |
| - <Output TaskParameter="PackageInfoItems" ItemName="PrebuiltPackageInfoItems" /> |
372 |
| - </ReadNuGetPackageInfos> |
| 376 | + <!-- Add some other potential top-level project directories for a more specific report. --> |
| 377 | + <ProjectDirectories Include="$(ToolsDir);$(TaskDirectory);$(BaseIntermediatePath)" /> |
| 378 | + <!-- Finally, scan entire source-build, in case project.assets.json ends up in an unexpected place. --> |
| 379 | + <ProjectDirectories Include="$(ProjectDir)" /> |
| 380 | + </ItemGroup> |
373 | 381 |
|
374 |
| - <WritePackageUsageData NuGetPackageInfos="@(PrebuiltPackageInfoItems)" |
375 |
| - ProjectDirectories="@(ProjectDirectories)" |
376 |
| - DataFile="$(PackageReportDataFile)" /> |
| 382 | + <WritePackageUsageData |
| 383 | + RestoredPackageFiles="@(AllRestoredPackageFiles)" |
| 384 | + TarballPrebuiltPackageFiles="@(TarballPrebuiltPackageFiles)" |
| 385 | + SourceBuiltPackageFiles="@(SourceBuiltPackageFiles)" |
| 386 | + PlatformsRuntimeJsonFiles="@(PlatformsRuntimeJsonFiles)" |
| 387 | + TargetRid="$(TargetRid)" |
| 388 | + ProjectDirectories="@(ProjectDirectories)" |
| 389 | + RootDir="$(ProjectDir)" |
| 390 | + DataFile="$(PackageReportDataFile)" /> |
377 | 391 | </Target>
|
378 | 392 |
|
379 | 393 | <Target Name="GetAllProjectDirectories">
|
|
389 | 403 | </MSBuild>
|
390 | 404 | </Target>
|
391 | 405 |
|
392 |
| - <Target Name="ReportPrebuiltUsage" |
393 |
| - DependsOnTargets="GetPreviousReleasePrebuiltPackageInfos"> |
| 406 | + <Target Name="ReportPrebuiltUsage"> |
| 407 | + <PropertyGroup> |
| 408 | + <BaselineDataFile>$(ToolsLocalDir)prebuilt-baseline-</BaselineDataFile> |
| 409 | + <BaselineDataFile Condition="'$(OfflineBuild)' == 'true'">$(BaselineDataFile)offline.xml</BaselineDataFile> |
| 410 | + <BaselineDataFile Condition="'$(OfflineBuild)' != 'true'">$(BaselineDataFile)online.xml</BaselineDataFile> |
| 411 | + |
| 412 | + <ContinueOnPrebuiltBaselineError Condition="'$(ContinueOnPrebuiltBaselineError)' == ''">false</ContinueOnPrebuiltBaselineError> |
| 413 | + </PropertyGroup> |
| 414 | + |
| 415 | + <ValidateUsageAgainstBaseline |
| 416 | + DataFile="$(PackageReportDataFile)" |
| 417 | + BaselineDataFile="$(BaselineDataFile)" |
| 418 | + OutputBaselineFile="$(PackageReportDir)generated-new-baseline.xml" |
| 419 | + OutputReportFile="$(PackageReportDir)baseline-comparison.xml" |
| 420 | + ContinueOnError="$(ContinueOnPrebuiltBaselineError)" /> |
| 421 | + |
394 | 422 | <ItemGroup>
|
395 |
| - <PackageVersionPropsSnapshotFiles Include="$(PackageReportDir)PackageVersions.props.pre.*.xml" /> |
| 423 | + <PackageVersionPropsSavedSnapshotFiles Include="$(PackageReportDir)snapshots/PackageVersions.props.pre.*.xml" /> |
396 | 424 | </ItemGroup>
|
| 425 | + |
397 | 426 | <WriteUsageReports DataFile="$(PackageReportDataFile)"
|
398 |
| - PackageVersionPropsSnapshots="@(PackageVersionPropsSnapshotFiles)" |
| 427 | + PackageVersionPropsSnapshots="@(PackageVersionPropsSavedSnapshotFiles)" |
399 | 428 | ProdConBuildManifestFile="$(ProdConManifestFile)"
|
400 | 429 | PoisonedReportFile="$(PoisonedReportFile)"
|
401 |
| - PreviousReleasePrebuiltPackageInfos="@(PreviousReleasePrebuiltPackageInfos)" |
402 | 430 | OutputDirectory="$(PackageReportDir)" />
|
403 | 431 | </Target>
|
404 | 432 |
|
405 |
| - <Import Project="$(ProjectDir)tools-local/earlier-prebuilts.targets" /> |
406 |
| - |
407 | 433 | <Target Name="GetProjectDirectory" Outputs="$(ProjectDirectory)" />
|
408 | 434 | <Target Name="GetOrchestratedManifestBuildName" Outputs="$(OrchestratedManifestBuildName)" />
|
409 | 435 | <Target Name="GetOfficialBuildId" Outputs="$(OfficialBuildId)" />
|
|
0 commit comments