From e26e2ae708f05d0d2ebb70df06d0706fe7400d05 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Fri, 29 Dec 2023 11:49:35 +0800 Subject: [PATCH 1/3] Update NuGetSourceRepositoryProvider.cs use SettingsUtility.GetEnabledSources() --- src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs b/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs index 619ae2bf8d..8d5dd35cf1 100644 --- a/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs +++ b/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs @@ -51,7 +51,7 @@ public NuGetSourceRepositoryProvider(ISettings settings, ICakeConfiguration conf _localRepositories.Add(CreateRepository(SettingsUtility.GetGlobalPackagesFolder(settings))); _localRepositories.AddRange(SettingsUtility.GetFallbackPackageFolders(settings).Select(CreateRepository)); - var packageSources = new PackageSourceProvider(settings).LoadPackageSources().ToList(); + var packageSources = SettingsUtility.GetEnabledSources().ToList(); if (package.Address != null) { From cc062fe486d943270e26a84e84781920096809f6 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Fri, 29 Dec 2023 11:50:29 +0800 Subject: [PATCH 2/3] Update NuGetSourceRepositoryProvider.cs --- src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs b/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs index 8d5dd35cf1..02bd73a533 100644 --- a/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs +++ b/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs @@ -51,7 +51,7 @@ public NuGetSourceRepositoryProvider(ISettings settings, ICakeConfiguration conf _localRepositories.Add(CreateRepository(SettingsUtility.GetGlobalPackagesFolder(settings))); _localRepositories.AddRange(SettingsUtility.GetFallbackPackageFolders(settings).Select(CreateRepository)); - var packageSources = SettingsUtility.GetEnabledSources().ToList(); + var packageSources = SettingsUtility.GetEnabledSources(settings).ToList(); if (package.Address != null) { From a9cb965c923a92ee4d5379dee1ba40d22314a450 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 3 Jan 2024 13:25:08 +0800 Subject: [PATCH 3/3] Update NuGetSourceRepositoryProvider.cs --- .../Client/NuGetSourceRepositoryProvider.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs b/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs index 02bd73a533..36eaceba8b 100644 --- a/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs +++ b/src/Cake.NuGet/Client/NuGetSourceRepositoryProvider.cs @@ -85,16 +85,13 @@ public NuGetSourceRepositoryProvider(ISettings settings, ICakeConfiguration conf // Only add sources added via NuGet.config if nuget_source configuration value is not specified. foreach (var source in packageSources) { - if (source.IsEnabled) - { - var repository = CreateRepository(source); - _repositories.Add(repository); + var repository = CreateRepository(source); + _repositories.Add(repository); - // If source is not specified in directive, add it as primary source. - if (package.Address == null) - { - _primaryRepositories.Add(repository); - } + // If source is not specified in directive, add it as primary source. + if (package.Address == null) + { + _primaryRepositories.Add(repository); } } } @@ -102,7 +99,6 @@ public NuGetSourceRepositoryProvider(ISettings settings, ICakeConfiguration conf SourceRepository GetOrCreateRepository(string source) { var packageSource = packageSources - .Where(p => p.IsEnabled) .FirstOrDefault(p => p.Source.Equals(source, StringComparison.OrdinalIgnoreCase)); return packageSource == null ?