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