dotnet-installer/src/dotnet/commands/dotnet-build/BuildCommandParser.cs

37 lines
1.5 KiB
C#
Raw Normal View History

// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Linq;
using Microsoft.DotNet.Cli.CommandLine;
namespace Microsoft.DotNet.Cli
{
internal static class BuildCommandParser
{
public static Command Build() =>
Create.Command(
"build",
".NET Builder",
2017-03-09 14:47:02 -08:00
Accept.ZeroOrMoreArguments,
CommonOptions.HelpOption(),
Create.Option(
"-o|--output",
"Output directory in which to place built artifacts.",
Accept.ExactlyOneArgument
.With(name: "OUTPUT_DIR")
.ForwardAs(o => $"/p:OutputPath={o.Arguments.Single()}")),
2017-03-09 16:11:58 -08:00
CommonOptions.FrameworkOption(),
CommonOptions.RuntimeOption(),
CommonOptions.ConfigurationOption(),
2017-03-10 01:10:23 -08:00
CommonOptions.VersionSuffixOption(),
Create.Option(
"--no-incremental",
"Disables incremental build."),
Create.Option(
"--no-dependencies",
"Set this flag to ignore project-to-project references and only build the root project",
Accept.NoArguments
.ForwardAs("/p:BuildProjectReferences=false")),
CommonOptions.VerbosityOption());
}
}