Fix annotated prebuilt report again (#15436)
Co-authored-by: Michael Simons <msimons@microsoft.com>
This commit is contained in:
parent
48873c2344
commit
2df59d748a
3 changed files with 26 additions and 12 deletions
|
@ -17,7 +17,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.UsageReport
|
||||||
public class WriteUsageReports : Task
|
public class WriteUsageReports : Task
|
||||||
{
|
{
|
||||||
private const string SnapshotPrefix = "PackageVersions.";
|
private const string SnapshotPrefix = "PackageVersions.";
|
||||||
private const string SnapshotSuffix = ".Current.props";
|
private const string SnapshotSuffix = ".Snapshot.props";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Source usage data JSON file.
|
/// Source usage data JSON file.
|
||||||
|
@ -26,7 +26,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.UsageReport
|
||||||
public string DataFile { get; set; }
|
public string DataFile { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A set of "PackageVersions.{repo}.Current.props" files. They are analyzed to find
|
/// A set of "PackageVersions.{repo}.Snapshot.props" files. They are analyzed to find
|
||||||
/// packages built during source-build, and which repo built them. This info is added to the
|
/// packages built during source-build, and which repo built them. This info is added to the
|
||||||
/// report. New packages are associated to a repo by going through each PVP in ascending
|
/// report. New packages are associated to a repo by going through each PVP in ascending
|
||||||
/// file modification order.
|
/// file modification order.
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
<!-- Paths to the version props files -->
|
<!-- Paths to the version props files -->
|
||||||
<CurrentSourceBuiltPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Current.props</CurrentSourceBuiltPackageVersionPropsPath>
|
<CurrentSourceBuiltPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Current.props</CurrentSourceBuiltPackageVersionPropsPath>
|
||||||
<PreviouslySourceBuiltPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Previous.props</PreviouslySourceBuiltPackageVersionPropsPath>
|
<PreviouslySourceBuiltPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Previous.props</PreviouslySourceBuiltPackageVersionPropsPath>
|
||||||
|
<SnapshotPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Snapshot.props</SnapshotPackageVersionPropsPath>
|
||||||
<PackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).props</PackageVersionPropsPath>
|
<PackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).props</PackageVersionPropsPath>
|
||||||
<PackageVersionPropsFlowType>AllPackages</PackageVersionPropsFlowType>
|
<PackageVersionPropsFlowType>AllPackages</PackageVersionPropsFlowType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
@ -225,17 +225,30 @@
|
||||||
|
|
||||||
<!-- Write the build input properties, then save off a copy that will be used for generating usage reports later -->
|
<!-- Write the build input properties, then save off a copy that will be used for generating usage reports later -->
|
||||||
<WritePackageVersionsProps NuGetPackages="@(_CurrentSourceBuiltPackages)"
|
<WritePackageVersionsProps NuGetPackages="@(_CurrentSourceBuiltPackages)"
|
||||||
ExtraProperties="@(ExtraPackageVersionPropsPackageInfo)"
|
ExtraProperties="@(ExtraPackageVersionPropsPackageInfo)"
|
||||||
VersionPropsFlowType="$(PackageVersionPropsFlowType)"
|
VersionPropsFlowType="$(PackageVersionPropsFlowType)"
|
||||||
VersionDetails="$(_VersionDetailsXml)"
|
VersionDetails="$(_VersionDetailsXml)"
|
||||||
AdditionalAssetDirs="@(_CurrentAdditionalAssetDirs)"
|
AdditionalAssetDirs="@(_CurrentAdditionalAssetDirs)"
|
||||||
OutputPath="$(CurrentSourceBuiltPackageVersionPropsPath)" />
|
OutputPath="$(CurrentSourceBuiltPackageVersionPropsPath)" />
|
||||||
|
|
||||||
<!-- Create previously source-built inputs info -->
|
<!-- Create previously source-built inputs info -->
|
||||||
<WritePackageVersionsProps NuGetPackages="@(_PreviouslyBuiltSourceBuiltPackages)"
|
<WritePackageVersionsProps NuGetPackages="@(_PreviouslyBuiltSourceBuiltPackages)"
|
||||||
VersionPropsFlowType="$(PackageVersionPropsFlowType)"
|
VersionPropsFlowType="$(PackageVersionPropsFlowType)"
|
||||||
VersionDetails="$(_VersionDetailsXml)"
|
VersionDetails="$(_VersionDetailsXml)"
|
||||||
OutputPath="$(PreviouslySourceBuiltPackageVersionPropsPath)" />
|
OutputPath="$(PreviouslySourceBuiltPackageVersionPropsPath)" />
|
||||||
|
|
||||||
|
<!-- Write a full package version props (unfiltered) that will be used to track which repo creates a package.
|
||||||
|
Because not all repos implement the repo API (e.g. some are external), it's difficult to consistently gather
|
||||||
|
a list of packages from the output of each repo. This may be an area for improvement later.
|
||||||
|
|
||||||
|
Instead, we rely on the package version props file that is built up
|
||||||
|
before each build. If the full list of packages grows by package A, B and C between repo Y and Z, then Y produced
|
||||||
|
A B and C.
|
||||||
|
|
||||||
|
A key element of this algorith is that we must write the full package version props and not the filtered version. -->
|
||||||
|
<WritePackageVersionsProps NuGetPackages="@(_CurrentSourceBuiltPackages)"
|
||||||
|
VersionPropsFlowType="AllPackages"
|
||||||
|
OutputPath="$(SnapshotPackageVersionPropsPath)" />
|
||||||
|
|
||||||
<!-- Write a single file that contains imports for both the current and previously built packages -->
|
<!-- Write a single file that contains imports for both the current and previously built packages -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
@ -601,7 +614,7 @@
|
||||||
Outputs="$(RepoCompletedSemaphorePath)WritePrebuiltUsageData.complete">
|
Outputs="$(RepoCompletedSemaphorePath)WritePrebuiltUsageData.complete">
|
||||||
<!-- Save the PVP snapshot of each build step to be evaluated while building the report. -->
|
<!-- Save the PVP snapshot of each build step to be evaluated while building the report. -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersionPropsSnapshotFiles Include="$(IntermediatePath)PackageVersions.*.Current.props" />
|
<PackageVersionPropsSnapshotFiles Include="$(IntermediatePath)PackageVersions.*.Snapshot.props" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Copy SourceFiles="@(PackageVersionPropsSnapshotFiles)" DestinationFolder="$(PackageReportDir)snapshots/" />
|
<Copy SourceFiles="@(PackageVersionPropsSnapshotFiles)" DestinationFolder="$(PackageReportDir)snapshots/" />
|
||||||
|
|
||||||
|
@ -687,7 +700,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersionPropsSavedSnapshotFiles Include="$(PackageReportDir)snapshots/PackageVersions.*.Current.props" />
|
<PackageVersionPropsSavedSnapshotFiles Include="$(PackageReportDir)snapshots/PackageVersions.*.Snapshot.props" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<WriteUsageReports DataFile="$(PackageReportDataFile)"
|
<WriteUsageReports DataFile="$(PackageReportDataFile)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue