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
|
||||
{
|
||||
private const string SnapshotPrefix = "PackageVersions.";
|
||||
private const string SnapshotSuffix = ".Current.props";
|
||||
private const string SnapshotSuffix = ".Snapshot.props";
|
||||
|
||||
/// <summary>
|
||||
/// Source usage data JSON file.
|
||||
|
@ -26,7 +26,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.UsageReport
|
|||
public string DataFile { get; set; }
|
||||
|
||||
/// <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
|
||||
/// report. New packages are associated to a repo by going through each PVP in ascending
|
||||
/// file modification order.
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<!-- Paths to the version props files -->
|
||||
<CurrentSourceBuiltPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Current.props</CurrentSourceBuiltPackageVersionPropsPath>
|
||||
<PreviouslySourceBuiltPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Previous.props</PreviouslySourceBuiltPackageVersionPropsPath>
|
||||
<SnapshotPackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).Snapshot.props</SnapshotPackageVersionPropsPath>
|
||||
<PackageVersionPropsPath>$(IntermediatePath)PackageVersions.$(RepositoryName).props</PackageVersionPropsPath>
|
||||
<PackageVersionPropsFlowType>AllPackages</PackageVersionPropsFlowType>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -237,6 +237,19 @@
|
|||
VersionDetails="$(_VersionDetailsXml)"
|
||||
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 -->
|
||||
<PropertyGroup>
|
||||
<PackageVersionsPropsContents>
|
||||
|
@ -601,7 +614,7 @@
|
|||
Outputs="$(RepoCompletedSemaphorePath)WritePrebuiltUsageData.complete">
|
||||
<!-- Save the PVP snapshot of each build step to be evaluated while building the report. -->
|
||||
<ItemGroup>
|
||||
<PackageVersionPropsSnapshotFiles Include="$(IntermediatePath)PackageVersions.*.Current.props" />
|
||||
<PackageVersionPropsSnapshotFiles Include="$(IntermediatePath)PackageVersions.*.Snapshot.props" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(PackageVersionPropsSnapshotFiles)" DestinationFolder="$(PackageReportDir)snapshots/" />
|
||||
|
||||
|
@ -687,7 +700,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageVersionPropsSavedSnapshotFiles Include="$(PackageReportDir)snapshots/PackageVersions.*.Current.props" />
|
||||
<PackageVersionPropsSavedSnapshotFiles Include="$(PackageReportDir)snapshots/PackageVersions.*.Snapshot.props" />
|
||||
</ItemGroup>
|
||||
|
||||
<WriteUsageReports DataFile="$(PackageReportDataFile)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue