From e11e0ac367d4448c1d315dd6edb4f1e17a4cf432 Mon Sep 17 00:00:00 2001 From: Cici Li Date: Wed, 22 Jan 2025 03:15:08 +0000 Subject: [PATCH 1/2] Add the required package source --- .../NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs b/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs index d9e91b979a5..8875c7027b1 100644 --- a/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs +++ b/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs @@ -111,6 +111,7 @@ public async Task InstallPackageForPRInPMC(ProjectTemplate projectTemplate) var v100 = "1.0.0"; await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, packageName, v100); simpleTestPathContext.Settings.AddSource(NuGetConstants.NuGetHostName, NuGetConstants.V3FeedUrl); + simpleTestPathContext.Settings.AddSource("AndroidFeed", "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-a8cd27e4/nuget/v3/index.json"); using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, simpleTestPathContext: simpleTestPathContext)) { @@ -148,6 +149,7 @@ public async Task UpdatePackageForPRInPMC(ProjectTemplate projectTemplate) await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, packageName, v100); await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, packageName, v200); simpleTestPathContext.Settings.AddSource(NuGetConstants.NuGetHostName, NuGetConstants.V3FeedUrl); + simpleTestPathContext.Settings.AddSource("AndroidFeed", "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-a8cd27e4/nuget/v3/index.json"); using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, simpleTestPathContext: simpleTestPathContext)) { @@ -187,6 +189,7 @@ public async Task UninstallPackageForPRInPMC(ProjectTemplate projectTemplate) await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, PackageName, v100); simpleTestPathContext.Settings.AddSource(NuGetConstants.NuGetHostName, NuGetConstants.V3FeedUrl); + simpleTestPathContext.Settings.AddSource("AndroidFeed", "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-a8cd27e4/nuget/v3/index.json"); using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, simpleTestPathContext: simpleTestPathContext)) { From 4e5335c9b651046b1b9d0f70d66af88998b024a0 Mon Sep 17 00:00:00 2001 From: Cici Li Date: Fri, 24 Jan 2025 03:19:30 +0000 Subject: [PATCH 2/2] Use a share string for the feed url --- .../NuGet.Configuration/PackageSource/NuGetConstants.cs | 2 ++ src/NuGet.Core/NuGet.Configuration/PublicAPI.Shipped.txt | 2 ++ .../NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/NuGet.Core/NuGet.Configuration/PackageSource/NuGetConstants.cs b/src/NuGet.Core/NuGet.Configuration/PackageSource/NuGetConstants.cs index 02ec902fab8..111020897d3 100644 --- a/src/NuGet.Core/NuGet.Configuration/PackageSource/NuGetConstants.cs +++ b/src/NuGet.Core/NuGet.Configuration/PackageSource/NuGetConstants.cs @@ -7,6 +7,7 @@ public static class NuGetConstants { public static readonly string NuGetHostName = "nuget.org"; public static readonly string NuGetSymbolHostName = "nuget.smbsrc.net"; + public static readonly string AndroidFeedName = "AndroidFeed"; public const string V3FeedUrl = "https://api.nuget.org/v3/index.json"; public const string V2FeedUrl = "https://www.nuget.org/api/v2/"; @@ -14,6 +15,7 @@ public static class NuGetConstants public static readonly string V2LegacyFeedUrl = "https://go.microsoft.com/fwlink/?LinkID=230477"; public static readonly string V1FeedUrl = "https://go.microsoft.com/fwlink/?LinkID=206669"; + public static readonly string AndroidFeedUrl = "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-a8cd27e4/nuget/v3/index.json"; /// /// NuGet.org gallery Url used as a source display name and as a default "id" when storing nuget.org API key. diff --git a/src/NuGet.Core/NuGet.Configuration/PublicAPI.Shipped.txt b/src/NuGet.Core/NuGet.Configuration/PublicAPI.Shipped.txt index 33dc35d8d22..63ed38b99de 100644 --- a/src/NuGet.Core/NuGet.Configuration/PublicAPI.Shipped.txt +++ b/src/NuGet.Core/NuGet.Configuration/PublicAPI.Shipped.txt @@ -533,6 +533,7 @@ static readonly NuGet.Configuration.NuGetConstants.ManifestSymbolsExtension -> s static readonly NuGet.Configuration.NuGetConstants.NuGetHostName -> string! static readonly NuGet.Configuration.NuGetConstants.NuGetSolutionSettingsFolder -> string! static readonly NuGet.Configuration.NuGetConstants.NuGetSymbolHostName -> string! +static readonly NuGet.Configuration.NuGetConstants.AndroidFeedName -> string! static readonly NuGet.Configuration.NuGetConstants.PackageExtension -> string! static readonly NuGet.Configuration.NuGetConstants.PackageReferenceFile -> string! static readonly NuGet.Configuration.NuGetConstants.PackageSpecFileName -> string! @@ -541,6 +542,7 @@ static readonly NuGet.Configuration.NuGetConstants.ReadmeFileName -> string! static readonly NuGet.Configuration.NuGetConstants.SnupkgExtension -> string! static readonly NuGet.Configuration.NuGetConstants.SymbolsExtension -> string! static readonly NuGet.Configuration.NuGetConstants.V1FeedUrl -> string! +static readonly NuGet.Configuration.NuGetConstants.AndroidFeedUrl -> string! static readonly NuGet.Configuration.NuGetConstants.V2LegacyFeedUrl -> string! static readonly NuGet.Configuration.NuGetConstants.V2LegacyOfficialPackageSourceUrl -> string! static readonly NuGet.Configuration.OwnersItem.OwnersListSeparator -> char diff --git a/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs b/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs index 8875c7027b1..ef9e4ab7b50 100644 --- a/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs +++ b/test/NuGet.Tests.Apex/NuGet.Tests.Apex.Daily/NuGetConsoleTestCase.cs @@ -111,7 +111,7 @@ public async Task InstallPackageForPRInPMC(ProjectTemplate projectTemplate) var v100 = "1.0.0"; await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, packageName, v100); simpleTestPathContext.Settings.AddSource(NuGetConstants.NuGetHostName, NuGetConstants.V3FeedUrl); - simpleTestPathContext.Settings.AddSource("AndroidFeed", "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-a8cd27e4/nuget/v3/index.json"); + simpleTestPathContext.Settings.AddSource(NuGetConstants.AndroidFeedName, NuGetConstants.AndroidFeedUrl); using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, simpleTestPathContext: simpleTestPathContext)) { @@ -149,7 +149,7 @@ public async Task UpdatePackageForPRInPMC(ProjectTemplate projectTemplate) await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, packageName, v100); await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, packageName, v200); simpleTestPathContext.Settings.AddSource(NuGetConstants.NuGetHostName, NuGetConstants.V3FeedUrl); - simpleTestPathContext.Settings.AddSource("AndroidFeed", "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-a8cd27e4/nuget/v3/index.json"); + simpleTestPathContext.Settings.AddSource(NuGetConstants.AndroidFeedName, NuGetConstants.AndroidFeedUrl); using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, simpleTestPathContext: simpleTestPathContext)) { @@ -189,7 +189,7 @@ public async Task UninstallPackageForPRInPMC(ProjectTemplate projectTemplate) await CommonUtility.CreatePackageInSourceAsync(simpleTestPathContext.PackageSource, PackageName, v100); simpleTestPathContext.Settings.AddSource(NuGetConstants.NuGetHostName, NuGetConstants.V3FeedUrl); - simpleTestPathContext.Settings.AddSource("AndroidFeed", "https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-a8cd27e4/nuget/v3/index.json"); + simpleTestPathContext.Settings.AddSource(NuGetConstants.AndroidFeedName, NuGetConstants.AndroidFeedUrl); using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, simpleTestPathContext: simpleTestPathContext)) {