Skip to content

Commit

Permalink
Fix regression in SBRP usage report
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSimons committed Jan 24, 2025
1 parent b687d2d commit e95779f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/SourceBuild/content/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@

<GitInfoDir>$([MSBuild]::NormalizeDirectory('$(PrereqsDir)', 'git-info'))</GitInfoDir>

<ProjectAssetsJsonBackupDir>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', 'project-assets-json'))</ProjectAssetsJsonBackupDir>
<PackageReportDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'prebuilt-report'))</PackageReportDir>
<ResultingPrebuiltPackagesDir>$([MSBuild]::NormalizeDirectory('$(PackageReportDir)', 'prebuilt-packages'))</ResultingPrebuiltPackagesDir>
<SbrpRepoSrcDir>$([MSBuild]::NormalizeDirectory('$(SrcDir)', 'source-build-reference-packages', 'src'))</SbrpRepoSrcDir>
Expand Down
2 changes: 1 addition & 1 deletion src/SourceBuild/content/eng/finish-source-only.proj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BeforeTargets="Build"
Condition="'$(ReportSbrpUsage)' == 'true'">
<WriteSbrpUsageReport SbrpRepoSrcPath="$(SbrpRepoSrcDir)"
SrcPath="$(SrcDir)"
ProjectAssetsJsonPath="$(ProjectAssetsJsonBackupDir)"
OutputPath="$(ArtifactsLogDir)" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public class WriteSbrpUsageReport : Task
public required string SbrpRepoSrcPath { get; set; }

/// <summary>
/// Path to the VMR src directory.
/// Path to the build's project.asserts.json files.
/// </summary>
[Required]
public required string SrcPath { get; set; }
public required string ProjectAssetsJsonPath { get; set; }

/// <summary>
/// Path to the usage report to.
Expand Down Expand Up @@ -144,7 +144,7 @@ private void ReadSbrpPackages(string packageType, bool trackTfms)

private void ScanProjectReferences()
{
foreach (string projectJsonFile in Directory.GetFiles(SrcPath, "project.assets.json", SearchOption.AllDirectories))
foreach (string projectJsonFile in Directory.GetFiles(ProjectAssetsJsonPath, "project.assets.json", SearchOption.AllDirectories))
{
LockFile lockFile = new LockFileFormat().Read(projectJsonFile);
foreach (LockFileTargetLibrary lib in lockFile.Targets.SelectMany(t => t.Libraries))
Expand Down
4 changes: 0 additions & 4 deletions src/SourceBuild/content/repo-projects/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,6 @@
<!-- Make a copy of project.assets.json files for prebuilt report generation. -->
<Target Name="BackupProjectAssetsJsonFiles"
Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<PropertyGroup>
<ProjectAssetsJsonBackupDir>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', 'project-assets-json'))</ProjectAssetsJsonBackupDir>
</PropertyGroup>

<ItemGroup>
<ProjectAssetsJsonFile Include="$(RepoArtifactsDir)**/project.assets.json" />
</ItemGroup>
Expand Down

0 comments on commit e95779f

Please sign in to comment.