Update for publishing and package source mappings (#19343)

This commit is contained in:
Nikola Milosavljevic 2024-04-08 10:54:14 -07:00 committed by GitHub
parent 8db3f660d4
commit aa3e889f67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 5 deletions

View file

@ -245,11 +245,11 @@ namespace Microsoft.DotNet.UnifiedBuild.Tasks
}
else if (packageSource.Equals(PreviouslySourceBuiltSourceName))
{
AddPackageSourceMappingIfPackageVersionNotInCurrentPackages(pkgSrc, packagePattern, previouslySourceBuiltPackages);
AddPackageSourceMappingIfPackageVersionsNotInCurrentPackages(pkgSrc, packagePattern, previouslySourceBuiltPackages);
}
else if (packageSource.Equals(PrebuiltSourceName))
{
AddPackageSourceMappingIfPackageVersionNotInCurrentPackages(pkgSrc, packagePattern, prebuiltPackages);
AddPackageSourceMappingIfPackageVersionsNotInCurrentPackages(pkgSrc, packagePattern, prebuiltPackages);
}
else // unknown/unexpected source
{
@ -260,16 +260,18 @@ namespace Microsoft.DotNet.UnifiedBuild.Tasks
return pkgSrc;
}
private void AddPackageSourceMappingIfPackageVersionNotInCurrentPackages(XElement pkgSrc, string packagePattern, Dictionary<string, List<string>> packages)
private void AddPackageSourceMappingIfPackageVersionsNotInCurrentPackages(XElement pkgSrc, string packagePattern, Dictionary<string, List<string>> packages)
{
foreach (string version in packages[packagePattern])
{
if (!currentPackages[packagePattern].Contains(version))
// If any package version is in current packages, skip this package pattern
if (currentPackages[packagePattern].Contains(version))
{
pkgSrc.Add(new XElement("package", new XAttribute("pattern", packagePattern)));
return;
}
}
pkgSrc.Add(new XElement("package", new XAttribute("pattern", packagePattern)));
}
private void DiscoverPackagesFromAllSourceBuildSources(XElement pkgSourcesElement)

View file

@ -34,9 +34,11 @@
</ItemGroup>
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<RepositoryReference Include="roslyn-analyzers" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="source-build-externals" />
<RepositoryReference Include="source-build-reference-packages" />
<RepositoryReference Include="symreader" />
</ItemGroup>
<ItemGroup>

View file

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Fri, 5 Apr 2024 22:44:35 +0000
Subject: [PATCH] Stop publishing of additional packages
Backport: https://github.com/dotnet/roslyn-analyzers/pull/7282
---
eng/Publishing.props | 7 -------
1 file changed, 7 deletions(-)
diff --git a/eng/Publishing.props b/eng/Publishing.props
index 355f94a01..2d3ce7dde 100644
--- a/eng/Publishing.props
+++ b/eng/Publishing.props
@@ -3,11 +3,4 @@
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
</PropertyGroup>
- <ItemGroup>
- <ItemsToPushToBlobFeed Include="$(ArtifactsPackagesDir)Release\*.nupkg"
- IsShipping="true"
- UploadPathSegment="Roslyn-analyzers"
- Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
- </ItemGroup>
-
</Project>
\ No newline at end of file

View file

@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Sun, 7 Apr 2024 15:22:46 +0000
Subject: [PATCH] Stop publishing of additional packages
Backport: https://github.com/dotnet/symreader/pull/318
---
eng/Publishing.props | 13 -------------
1 file changed, 13 deletions(-)
delete mode 100644 eng/Publishing.props
diff --git a/eng/Publishing.props b/eng/Publishing.props
deleted file mode 100644
index 131a401..0000000
--- a/eng/Publishing.props
+++ /dev/null
@@ -1,13 +0,0 @@
-<Project>
-
- <ItemGroup>
- <!--
- Additional packages needed for source-only VMR build - https://github.com/dotnet/source-build/issues/4205
- -->
- <ItemsToPushToBlobFeed Include="$(ArtifactsPackagesDir)Release\**\*.nupkg"
- IsShipping="true"
- UploadPathSegment="Runtime"
- Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
- </ItemGroup>
-
-</Project>