Skip to content

Commit f68a748

Browse files
committed
Don't binplace for upload any "Vertical" visibility assets. They shouldn't be uploaded from jobs and they won't be in the asset manifest anyway.
1 parent 4b84ab1 commit f68a748

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/GetKnownArtifactsFromAssetManifests.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public sealed class GetKnownArtifactsFromAssetManifests : Build.Utilities.Task
2424
private const string RepoOriginAttributeName = "RepoOrigin";
2525
private const string NonShippingAttributeName = "NonShipping";
2626
private const string DotNetReleaseShippingAttributeName = "DotNetReleaseShipping";
27+
private const string VisibilityAttributeName = "Visibility";
28+
private const string DefaultVisibility = "External";
2729

2830
// Package metadata
2931
private const string PackageElementName = "Package";
@@ -69,7 +71,8 @@ public override bool Execute()
6971
{ PackageVersionAttributeName, package.Attribute(PackageVersionAttributeName)!.Value },
7072
{ RepoOriginAttributeName, package.Attribute(RepoOriginAttributeName)?.Value ?? string.Empty },
7173
{ NonShippingAttributeName, package.Attribute(NonShippingAttributeName)?.Value ?? string.Empty },
72-
{ DotNetReleaseShippingAttributeName, package.Attribute(DotNetReleaseShippingAttributeName)?.Value ?? string.Empty }
74+
{ DotNetReleaseShippingAttributeName, package.Attribute(DotNetReleaseShippingAttributeName)?.Value ?? string.Empty },
75+
{ VisibilityAttributeName, package.Attribute(VisibilityAttributeName)?.Value ?? DefaultVisibility },
7376
}))
7477
.Distinct(TaskItemManifestEqualityComparer.Instance)
7578
.ToArray();
@@ -81,7 +84,8 @@ public override bool Execute()
8184
{
8285
{ RepoOriginAttributeName, blob.Attribute(RepoOriginAttributeName)?.Value ?? string.Empty },
8386
{ NonShippingAttributeName, blob.Attribute(NonShippingAttributeName)?.Value ?? string.Empty },
84-
{ DotNetReleaseShippingAttributeName, blob.Attribute(DotNetReleaseShippingAttributeName)?.Value ?? string.Empty }
87+
{ DotNetReleaseShippingAttributeName, blob.Attribute(DotNetReleaseShippingAttributeName)?.Value ?? string.Empty },
88+
{ VisibilityAttributeName, blob.Attribute(VisibilityAttributeName)?.Value ?? DefaultVisibility },
8589
}))
8690
.Distinct(TaskItemManifestEqualityComparer.Instance)
8791
.ToArray();
@@ -110,4 +114,4 @@ public bool Equals(TaskItem? x, TaskItem? y)
110114

111115
public int GetHashCode([DisallowNull] TaskItem obj) => HashCode.Combine(obj.ItemSpec, obj.GetMetadata(PackageVersionAttributeName));
112116
}
113-
}
117+
}

src/SourceBuild/content/repo-projects/Directory.Build.targets

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,13 @@
554554
<ShippingFolder Condition="%(ProducedPackage.NonShipping) != 'true'">Shipping</ShippingFolder>
555555
</ProducedPackage>
556556

557-
<!-- When building from source, the Private.SourceBuilt.Artifacts archive already contains the nuget packages. -->
558-
<BinPlaceFile Include="@(ProducedPackage->'$(ArtifactsPackagesDir)%(ShippingFolder)/$(RepositoryName)/%(Identity).%(Version).nupkg')" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
559-
<BinPlaceFile Include="@(ProducedAsset->'$(ArtifactsAssetsDir)%(Identity)')" />
557+
<!--
558+
When building from source, the Private.SourceBuilt.Artifacts archive already contains the nuget packages.
559+
Don't binplace any packages or blobs with vertical visibility. These are only used for building other repos within this vertical
560+
and shouldn't be staged for upload.
561+
-->
562+
<BinPlaceFile Include="@(ProducedPackage->'$(ArtifactsPackagesDir)%(ShippingFolder)/$(RepositoryName)/%(Identity).%(Version).nupkg')" Condition="'$(DotNetBuildSourceOnly)' != 'true' and '%(Visibility)' != 'Vertical'" />
563+
<BinPlaceFile Include="@(ProducedAsset->'$(ArtifactsAssetsDir)%(Identity)')" Condition="'%(Visibility)' != 'Vertical'"/>
560564
</ItemGroup>
561565

562566
<!-- Add manifests from dependent verticals. -->

0 commit comments

Comments
 (0)