|
|
@ -83,6 +83,11 @@ namespace Volo.Abp.Cli.ProjectModification |
|
|
bool withSourceCode = false, |
|
|
bool withSourceCode = false, |
|
|
bool addSourceCodeToSolutionFile = false) |
|
|
bool addSourceCodeToSolutionFile = false) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (version == null) |
|
|
|
|
|
{ |
|
|
|
|
|
version = GetAbpVersionOrNull(projectFile); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
await AddAsPackageReference(projectFile, package, version, useDotnetCliToInstall); |
|
|
await AddAsPackageReference(projectFile, package, version, useDotnetCliToInstall); |
|
|
|
|
|
|
|
|
if (withSourceCode) |
|
|
if (withSourceCode) |
|
|
@ -204,11 +209,6 @@ namespace Volo.Abp.Cli.ProjectModification |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (version == null) |
|
|
|
|
|
{ |
|
|
|
|
|
version = GetAbpVersionOrNull(projectFileContent); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
using (DirectoryHelper.ChangeCurrentDirectory(Path.GetDirectoryName(projectFile))) |
|
|
using (DirectoryHelper.ChangeCurrentDirectory(Path.GetDirectoryName(projectFile))) |
|
|
{ |
|
|
{ |
|
|
Logger.LogInformation( |
|
|
Logger.LogInformation( |
|
|
@ -301,8 +301,10 @@ namespace Volo.Abp.Cli.ProjectModification |
|
|
return Task.CompletedTask; |
|
|
return Task.CompletedTask; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private string GetAbpVersionOrNull(string projectFileContent) |
|
|
private string GetAbpVersionOrNull(string projectFile) |
|
|
{ |
|
|
{ |
|
|
|
|
|
var projectFileContent = File.ReadAllText(projectFile); |
|
|
|
|
|
|
|
|
var doc = new XmlDocument() {PreserveWhitespace = true}; |
|
|
var doc = new XmlDocument() {PreserveWhitespace = true}; |
|
|
|
|
|
|
|
|
doc.Load(StreamHelper.GenerateStreamFromString(projectFileContent)); |
|
|
doc.Load(StreamHelper.GenerateStreamFromString(projectFileContent)); |
|
|
|