Skip to content

Commit

Permalink
Add parameter to search in custom nuget seource when resolving curren…
Browse files Browse the repository at this point in the history
…t sf package (#143)

* Add parameter to search in custom nuget seource when resolving current sf package

* Bump version
  • Loading branch information
RuzmanovDev authored Jun 18, 2021
1 parent f38975e commit 681456a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Sitefinity CLI/Commands/UpgradeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected virtual async Task ExecuteUpgrade()
}
}

await this.GenerateUpgradeConfig(sitefinityProjectFilePaths, newSitefinityPackage);
await this.GenerateUpgradeConfig(sitefinityProjectFilePaths, newSitefinityPackage, packageSources);

var updaterPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, Constants.SitefinityUpgradePowershellFolderName, "Updater.ps1");
this.visualStudioWorker.Initialize(this.SolutionPath);
Expand Down Expand Up @@ -278,7 +278,7 @@ private string ReadAllTextFromFile(string path)
}
}

private async Task GenerateUpgradeConfig(IEnumerable<string> projectFilePaths, NuGetPackage newSitefinityVersionPackageTree)
private async Task GenerateUpgradeConfig(IEnumerable<string> projectFilePaths, NuGetPackage newSitefinityVersionPackageTree, IEnumerable<string> packageSources)
{
this.logger.LogInformation("Exporting upgrade config...");

Expand All @@ -288,15 +288,15 @@ private async Task GenerateUpgradeConfig(IEnumerable<string> projectFilePaths, N

foreach (string projectFilePath in projectFilePaths)
{
await this.GenerateProjectUpgradeConfigSection(powerShellXmlConfig, powerShellXmlConfigNode, projectFilePath, newSitefinityVersionPackageTree);
await this.GenerateProjectUpgradeConfigSection(powerShellXmlConfig, powerShellXmlConfigNode, projectFilePath, newSitefinityVersionPackageTree, packageSources);
}

powerShellXmlConfig.Save(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Constants.SitefinityUpgradePowershellFolderName, "config.xml"));

this.logger.LogInformation("Successfully exported upgrade config!");
}

private async Task GenerateProjectUpgradeConfigSection(XmlDocument powerShellXmlConfig, XmlElement powerShellXmlConfigNode, string projectFilePath, NuGetPackage newSitefinityVersionPackageTree)
private async Task GenerateProjectUpgradeConfigSection(XmlDocument powerShellXmlConfig, XmlElement powerShellXmlConfigNode, string projectFilePath, NuGetPackage newSitefinityVersionPackageTree, IEnumerable<string> packageSources)
{
XmlElement projectNode = powerShellXmlConfig.CreateElement("project");
XmlAttribute projectNameAttribute = powerShellXmlConfig.CreateAttribute("name");
Expand All @@ -315,7 +315,7 @@ private async Task GenerateProjectUpgradeConfigSection(XmlDocument powerShellXml
this.logger.LogInformation($"Detected sitefinity version for '{projectFilePath}' - '{currentSitefinityVersion}'.");

this.logger.LogInformation($"Collecting Sitefinity NuGet package tree for '{projectFilePath}'...");
NuGetPackage currentSitefinityVersionPackageTree = await this.sitefinityPackageManager.GetSitefinityPackageTree(currentSitefinityVersion.ToString());
NuGetPackage currentSitefinityVersionPackageTree = await this.sitefinityPackageManager.GetSitefinityPackageTree(currentSitefinityVersion.ToString(), packageSources);

this.processedPackagesPerProjectCache[projectFilePath] = new HashSet<string>();
if (!this.TryAddPackageTreeToProjectUpgradeConfigSection(powerShellXmlConfig, projectNode, projectFilePath, currentSitefinityVersionPackageTree, newSitefinityVersionPackageTree))
Expand Down
4 changes: 2 additions & 2 deletions Sitefinity CLI/Sitefinity CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyName>sf</AssemblyName>
<RootNamespace>Sitefinity_CLI</RootNamespace>
<AssemblyVersion>1.1.0.21</AssemblyVersion>
<AssemblyVersion>1.1.0.22</AssemblyVersion>
<Version>1.1.0</Version>
<FileVersion>1.1.0.21</FileVersion>
<FileVersion>1.1.0.22</FileVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
</PropertyGroup>
Expand Down

0 comments on commit 681456a

Please sign in to comment.