From 9951184e5c29f705f33bc5741667a6e41abbb770 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 30 Nov 2023 11:39:38 +0300 Subject: [PATCH] Cli: Adjust package updaterfor studio packages --- .../VoloNugetPackagesVersionUpdater.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs index 71b28f9084..653cbc7b66 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs @@ -184,6 +184,7 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency var currentVersion = versionAttribute.Value; var isLeptonXPackage = packageId.Contains("LeptonX"); + var isStudioPackage = packageId.StartsWith("Volo.Abp.Studio."); if(isLeptonXPackage) { //'SemanticVersion.TryParse' can not parse the version if the version contains floating version resolution, such as '*-*' @@ -201,7 +202,7 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency if (!specifiedVersion.IsNullOrWhiteSpace()) { - if (isLeptonXPackage) + if (isLeptonXPackage || isStudioPackage) { Logger.LogWarning("Package: {0} could not be updated. Please manually update the package version yourself to prevent version mismatches.", packageId); continue; @@ -241,6 +242,10 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency latestVersion = (await _packageVersionCheckerService.GetLatestVersionOrNullAsync(leptonXPackageName, includeNightlyPreviews, includeReleaseCandidates))?.Version?.ToString(); } + else if(isStudioPackage) + { + latestVersion = (await _packageVersionCheckerService.GetLatestVersionOrNullAsync(packageId, includeNightlyPreviews, includeReleaseCandidates))?.Version?.ToString(); + } else { latestVersion = latestMyGetVersion == null ? await GetLatestVersionFromMyGet(packageId) : latestMyGetVersion; @@ -267,13 +272,13 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency SemanticVersion latestVersion; if (currentSemanticVersion.IsPrerelease && !switchToStable) { - latestVersion = latestNugetReleaseCandidateVersion == null || isLeptonXPackage + latestVersion = latestNugetReleaseCandidateVersion == null || isLeptonXPackage || isStudioPackage ? (await _packageVersionCheckerService.GetLatestVersionOrNullAsync(packageId, includeReleaseCandidates: true))?.Version : latestNugetReleaseCandidateVersion; } else { - latestVersion = latestNugetVersion == null || isLeptonXPackage + latestVersion = latestNugetVersion == null || isLeptonXPackage || isStudioPackage ? (await _packageVersionCheckerService.GetLatestVersionOrNullAsync(packageId, includeReleaseCandidates: includeReleaseCandidates))?.Version : latestNugetVersion; }