2017-03-06 11:57:19 -08:00
// 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.
2017-03-09 09:14:55 -08:00
using System.Linq ;
2017-03-06 11:57:19 -08:00
using Microsoft.DotNet.Cli.CommandLine ;
2017-03-19 14:35:11 -07:00
using Microsoft.DotNet.Tools ;
2017-03-10 13:36:18 -08:00
using LocalizableStrings = Microsoft . DotNet . Tools . Build . LocalizableStrings ;
2017-03-06 11:57:19 -08:00
namespace Microsoft.DotNet.Cli
{
internal static class BuildCommandParser
{
public static Command Build ( ) = >
2017-03-07 11:28:35 -08:00
Create . Command (
"build" ,
2017-03-10 13:36:18 -08:00
LocalizableStrings . AppFullName ,
2017-03-14 10:33:58 -07:00
Accept . ZeroOrMoreArguments ( )
2017-03-19 14:35:11 -07:00
. With ( name : CommonLocalizableStrings . CmdProjectFile ,
2017-03-14 10:33:58 -07:00
description :
"The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file." ) ,
2017-03-07 11:28:35 -08:00
CommonOptions . HelpOption ( ) ,
Create . Option (
"-o|--output" ,
2017-03-10 13:36:18 -08:00
LocalizableStrings . OutputOptionDescription ,
2017-03-10 17:11:19 -08:00
Accept . ExactlyOneArgument ( )
2017-03-10 13:36:18 -08:00
. With ( name : LocalizableStrings . OutputOptionName )
2017-03-16 13:22:08 -07:00
. ForwardAsSingle ( 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 ( ) ,
2017-03-07 11:28:35 -08:00
Create . Option (
"--no-incremental" ,
2017-03-10 13:36:18 -08:00
LocalizableStrings . NoIncrementialOptionDescription ) ,
2017-03-07 11:28:35 -08:00
Create . Option (
"--no-dependencies" ,
2017-03-10 13:36:18 -08:00
LocalizableStrings . NoDependenciesOptionDescription ,
2017-03-10 17:11:19 -08:00
Accept . NoArguments ( )
2017-03-07 11:28:35 -08:00
. ForwardAs ( "/p:BuildProjectReferences=false" ) ) ,
2017-06-01 21:25:06 -07:00
CommonOptions . NoRestoreOption ( ) ,
2017-03-07 11:28:35 -08:00
CommonOptions . VerbosityOption ( ) ) ;
2017-03-06 11:57:19 -08:00
}
}