Refactor output directory code
This commit is contained in:
parent
4908436958
commit
0f82ae37f3
49 changed files with 836 additions and 396 deletions
|
@ -22,6 +22,7 @@ namespace Microsoft.DotNet.Tools.Publish
|
|||
|
||||
var framework = app.Option("-f|--framework <FRAMEWORK>", "Target framework to compile for", CommandOptionType.SingleValue);
|
||||
var runtime = app.Option("-r|--runtime <RUNTIME_IDENTIFIER>", "Target runtime to publish for", CommandOptionType.SingleValue);
|
||||
var buildBasePath = app.Option("-b|--build-base-path <OUTPUT_DIR>", "Directory in which to place temporary outputs", CommandOptionType.SingleValue);
|
||||
var output = app.Option("-o|--output <OUTPUT_PATH>", "Path in which to publish the app", CommandOptionType.SingleValue);
|
||||
var configuration = app.Option("-c|--configuration <CONFIGURATION>", "Configuration under which to build", CommandOptionType.SingleValue);
|
||||
var projectPath = app.Argument("<PROJECT>", "The project to publish, defaults to the current directory. Can be a path to a project.json or a project directory");
|
||||
|
@ -33,11 +34,12 @@ namespace Microsoft.DotNet.Tools.Publish
|
|||
|
||||
publish.Framework = framework.Value();
|
||||
publish.Runtime = runtime.Value();
|
||||
publish.BuildBasePath = buildBasePath.Value();
|
||||
publish.OutputPath = output.Value();
|
||||
publish.Configuration = configuration.Value() ?? Constants.DefaultConfiguration;
|
||||
publish.NativeSubdirectories = nativeSubdirectories.HasValue();
|
||||
|
||||
publish.ProjectPath = projectPath.Value;
|
||||
|
||||
if (string.IsNullOrEmpty(publish.ProjectPath))
|
||||
{
|
||||
publish.ProjectPath = Directory.GetCurrentDirectory();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue