Fix publish when build was ran using build-base-path
This commit is contained in:
parent
1a0b9bba98
commit
cf0673333d
5 changed files with 33 additions and 9 deletions
|
@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
private Project _project;
|
||||
private readonly string _projectPath;
|
||||
private readonly string _outputDirectory;
|
||||
private readonly string _buidBasePathDirectory;
|
||||
private readonly string _buildBasePathDirectory;
|
||||
private readonly string _configuration;
|
||||
private readonly string _framework;
|
||||
private readonly string _versionSuffix;
|
||||
|
@ -44,9 +44,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
{
|
||||
get
|
||||
{
|
||||
return _buidBasePathDirectory == string.Empty ?
|
||||
return _buildBasePathDirectory == string.Empty ?
|
||||
"" :
|
||||
$"-b {_buidBasePathDirectory}";
|
||||
$"-b {_buildBasePathDirectory}";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
public BuildCommand(
|
||||
string projectPath,
|
||||
string output="",
|
||||
string buidBasePath="",
|
||||
string buildBasePath = "",
|
||||
string configuration="",
|
||||
string framework="",
|
||||
string runtime="",
|
||||
|
@ -224,7 +224,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
_project = ProjectReader.GetProject(projectPath);
|
||||
|
||||
_outputDirectory = output;
|
||||
_buidBasePathDirectory = buidBasePath;
|
||||
_buildBasePathDirectory = buildBasePath;
|
||||
_configuration = configuration;
|
||||
_versionSuffix = versionSuffix;
|
||||
_framework = framework;
|
||||
|
|
|
@ -21,8 +21,15 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
private readonly string _config;
|
||||
private readonly bool _noBuild;
|
||||
private readonly string _output;
|
||||
private readonly string _buidBasePathDirectory;
|
||||
|
||||
public PublishCommand(string projectPath, string framework = "", string runtime = "", string output = "", string config = "", bool forcePortable = false, bool noBuild = false)
|
||||
public PublishCommand(string projectPath,
|
||||
string framework = "",
|
||||
string runtime = "",
|
||||
string output = "",
|
||||
string config = "",
|
||||
bool noBuild = false,
|
||||
string buildBasePath = "")
|
||||
: base("dotnet")
|
||||
{
|
||||
_path = projectPath;
|
||||
|
@ -32,6 +39,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
_output = output;
|
||||
_config = config;
|
||||
_noBuild = noBuild;
|
||||
_buidBasePathDirectory = buildBasePath;
|
||||
}
|
||||
|
||||
public override CommandResult Execute(string args = "")
|
||||
|
@ -93,7 +101,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
|
||||
private string BuildArgs()
|
||||
{
|
||||
return $"{_path} {FrameworkOption} {RuntimeOption} {OutputOption} {ConfigOption} {NoBuildFlag}";
|
||||
return $"{_path} {FrameworkOption} {RuntimeOption} {OutputOption} {ConfigOption} {NoBuildFlag} {BuildBasePathOption}";
|
||||
}
|
||||
|
||||
private string FrameworkOption => string.IsNullOrEmpty(_framework) ? "" : $"-f {_framework}";
|
||||
|
@ -101,5 +109,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
private string OutputOption => string.IsNullOrEmpty(_output) ? "" : $"-o \"{_output}\"";
|
||||
private string ConfigOption => string.IsNullOrEmpty(_config) ? "" : $"-c {_output}";
|
||||
private string NoBuildFlag => _noBuild ? "--no-build" :"";
|
||||
private string BuildBasePathOption => string.IsNullOrEmpty(_buidBasePathDirectory) ? "" : $"-b {_buidBasePathDirectory}";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue