diff --git a/build_projects/dotnet-cli-build/DotNetPack.cs b/build_projects/dotnet-cli-build/DotNetPack.cs index 71752805e..1634d4bb1 100644 --- a/build_projects/dotnet-cli-build/DotNetPack.cs +++ b/build_projects/dotnet-cli-build/DotNetPack.cs @@ -85,7 +85,7 @@ namespace Microsoft.DotNet.Cli.Build { if (!string.IsNullOrEmpty(Runtime)) { - return $"/p:RuntimeIdentifier={Runtime}"; + return $"-p:RuntimeIdentifier={Runtime}"; } return null; diff --git a/build_projects/dotnet-cli-build/DotNetRestore.cs b/build_projects/dotnet-cli-build/DotNetRestore.cs index d7d984be3..3dfa15963 100644 --- a/build_projects/dotnet-cli-build/DotNetRestore.cs +++ b/build_projects/dotnet-cli-build/DotNetRestore.cs @@ -71,7 +71,7 @@ namespace Microsoft.DotNet.Cli.Build { if (SkipInvalidConfigurations) { - return "/p:SkipInvalidConfigurations=true"; + return "-p:SkipInvalidConfigurations=true"; } return null; @@ -81,7 +81,7 @@ namespace Microsoft.DotNet.Cli.Build { if (!string.IsNullOrEmpty(Runtime)) { - return $"/p:RuntimeIdentifier={Runtime}"; + return $"-p:RuntimeIdentifier={Runtime}"; } return null; diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs index a75472142..f5d9a174f 100644 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs +++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs @@ -354,12 +354,12 @@ namespace Microsoft.DotNet.Cli.Utils var args = new List(); args.Add(toolDepsJsonGeneratorProject); - args.Add($"/p:ProjectAssetsFile=\"{toolLockFile.Path}\""); - args.Add($"/p:ToolName={toolLibrary.Name}"); - args.Add($"/p:ProjectDepsFilePath={tempDepsFile}"); + args.Add($"-p:ProjectAssetsFile=\"{toolLockFile.Path}\""); + args.Add($"-p:ToolName={toolLibrary.Name}"); + args.Add($"-p:ProjectDepsFilePath={tempDepsFile}"); var toolTargetFramework = toolLockFile.Targets.First().TargetFramework.GetShortFolderName(); - args.Add($"/p:TargetFramework={toolTargetFramework}"); + args.Add($"-p:TargetFramework={toolTargetFramework}"); // Look for the .props file in the Microsoft.NETCore.App package, until NuGet @@ -384,7 +384,7 @@ namespace Microsoft.DotNet.Cli.Utils if (platformLibraryPropsFile != null) { - args.Add($"/p:AdditionalImport={platformLibraryPropsFile}"); + args.Add($"-p:AdditionalImport={platformLibraryPropsFile}"); } } } diff --git a/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs b/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs index e160617c5..d65c60dda 100644 --- a/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs +++ b/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs @@ -51,7 +51,7 @@ namespace Microsoft.DotNet.Cli.Utils private static string Escape(string arg) => // this is a workaround for https://github.com/Microsoft/msbuild/issues/1622 - (arg.StartsWith("/p:RestoreSources=", StringComparison.OrdinalIgnoreCase)) ? + (arg.StartsWith("-p:RestoreSources=", StringComparison.OrdinalIgnoreCase)) ? arg.Replace(";", "%3B") .Replace("://", ":%2F%2F") : arg; diff --git a/src/dotnet/CommonOptions.cs b/src/dotnet/CommonOptions.cs index bcd3b2268..0d8362c89 100644 --- a/src/dotnet/CommonOptions.cs +++ b/src/dotnet/CommonOptions.cs @@ -25,7 +25,7 @@ namespace Microsoft.DotNet.Cli "n", "normal", "d", "detailed", "diag", "diagnostic") - .ForwardAsSingle(o => $"/verbosity:{o.Arguments.Single()}")); + .ForwardAsSingle(o => $"-verbosity:{o.Arguments.Single()}")); public static Option FrameworkOption() => Create.Option( @@ -34,7 +34,7 @@ namespace Microsoft.DotNet.Cli Accept.ExactlyOneArgument() .WithSuggestionsFrom(_ => Suggest.TargetFrameworksFromProjectFile()) .With(name: "FRAMEWORK") - .ForwardAsSingle(o => $"/p:TargetFramework={o.Arguments.Single()}")); + .ForwardAsSingle(o => $"-p:TargetFramework={o.Arguments.Single()}")); public static Option RuntimeOption() => Create.Option( @@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Cli Accept.ExactlyOneArgument() .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: "RUNTIME_IDENTIFIER") - .ForwardAsSingle(o => $"/p:RuntimeIdentifier={o.Arguments.Single()}")); + .ForwardAsSingle(o => $"-p:RuntimeIdentifier={o.Arguments.Single()}")); public static Option ConfigurationOption() => Create.Option( @@ -52,7 +52,7 @@ namespace Microsoft.DotNet.Cli Accept.ExactlyOneArgument() .With(name: "CONFIGURATION") .WithSuggestionsFrom("DEBUG", "RELEASE") - .ForwardAsSingle(o => $"/p:Configuration={o.Arguments.Single()}")); + .ForwardAsSingle(o => $"-p:Configuration={o.Arguments.Single()}")); public static Option VersionSuffixOption() => Create.Option( @@ -60,7 +60,7 @@ namespace Microsoft.DotNet.Cli CommonLocalizableStrings.CmdVersionSuffixDescription, Accept.ExactlyOneArgument() .With(name: "VERSION_SUFFIX") - .ForwardAsSingle(o => $"/p:VersionSuffix={o.Arguments.Single()}")); + .ForwardAsSingle(o => $"-p:VersionSuffix={o.Arguments.Single()}")); public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) => rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory())); diff --git a/src/dotnet/commands/RestoringCommand.cs b/src/dotnet/commands/RestoringCommand.cs index 8d4f3c923..1c4355c11 100644 --- a/src/dotnet/commands/RestoringCommand.cs +++ b/src/dotnet/commands/RestoringCommand.cs @@ -36,10 +36,10 @@ namespace Microsoft.DotNet.Tools if (HasArgumentToExcludeFromRestore(parsedArguments)) { - return Prepend("/nologo", msbuildArgs); + return Prepend("-nologo", msbuildArgs); } - return Prepend("/restore", msbuildArgs); + return Prepend("-restore", msbuildArgs); } private static RestoreCommand GetSeparateRestoreCommand( @@ -70,7 +70,7 @@ namespace Microsoft.DotNet.Tools => arguments.Any(a => IsExcludedFromRestore(a)); private static bool IsExcludedFromRestore(string argument) - => argument.StartsWith("/p:TargetFramework=", StringComparison.Ordinal); + => argument.StartsWith("-p:TargetFramework=", StringComparison.Ordinal); public override int Execute() { diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs b/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs index c0af31625..ee2e3da3d 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs @@ -99,19 +99,19 @@ namespace Microsoft.DotNet.Tools.Add.PackageReference args.Add(projectFilePath); // Pass the task as generate restore Dependency Graph file - args.Add("/t:GenerateRestoreGraphFile"); + args.Add("-t:GenerateRestoreGraphFile"); // Pass Dependency Graph file output path - args.Add($"/p:RestoreGraphOutputPath=\"{dgFilePath}\""); + args.Add($"-p:RestoreGraphOutputPath=\"{dgFilePath}\""); // Turn off recursive restore - args.Add($"/p:RestoreRecursive=false"); + args.Add($"-p:RestoreRecursive=false"); // Turn off restore for Dotnet cli tool references so that we do not generate extra dg specs - args.Add($"/p:RestoreDotnetCliToolReferences=false"); + args.Add($"-p:RestoreDotnetCliToolReferences=false"); // Output should not include MSBuild version header - args.Add("/nologo"); + args.Add("-nologo"); var result = new MSBuildForwardingApp(args).Execute(); diff --git a/src/dotnet/commands/dotnet-build/BuildCommand.cs b/src/dotnet/commands/dotnet-build/BuildCommand.cs index 3fcee0925..5fd7bc1aa 100644 --- a/src/dotnet/commands/dotnet-build/BuildCommand.cs +++ b/src/dotnet/commands/dotnet-build/BuildCommand.cs @@ -37,15 +37,15 @@ namespace Microsoft.DotNet.Tools.Build var appliedBuildOptions = result["dotnet"]["build"]; - msbuildArgs.Add($"/clp:Summary"); + msbuildArgs.Add($"-clp:Summary"); if (appliedBuildOptions.HasOption("--no-incremental")) { - msbuildArgs.Add("/t:Rebuild"); + msbuildArgs.Add("-t:Rebuild"); } else { - msbuildArgs.Add("/t:Build"); + msbuildArgs.Add("-t:Build"); } msbuildArgs.AddRange(appliedBuildOptions.OptionValuesToBeForwarded()); diff --git a/src/dotnet/commands/dotnet-build/BuildCommandParser.cs b/src/dotnet/commands/dotnet-build/BuildCommandParser.cs index 76da0258e..e59dce3d4 100644 --- a/src/dotnet/commands/dotnet-build/BuildCommandParser.cs +++ b/src/dotnet/commands/dotnet-build/BuildCommandParser.cs @@ -25,7 +25,7 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOptionName) - .ForwardAsSingle(o => $"/p:OutputPath={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:OutputPath={o.Arguments.Single()}")), CommonOptions.FrameworkOption(), CommonOptions.RuntimeOption(), CommonOptions.ConfigurationOption(), @@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Cli "--no-dependencies", LocalizableStrings.NoDependenciesOptionDescription, Accept.NoArguments() - .ForwardAs("/p:BuildProjectReferences=false")), + .ForwardAs("-p:BuildProjectReferences=false")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); } diff --git a/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs b/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs index c88d1ede9..46ba2b347 100644 --- a/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs +++ b/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs @@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.CmdOutputDirDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) - .ForwardAsSingle(o => $"/p:OutputPath={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:OutputPath={o.Arguments.Single()}")), CommonOptions.FrameworkOption(), CommonOptions.RuntimeOption(), CommonOptions.ConfigurationOption(), diff --git a/src/dotnet/commands/dotnet-clean/Program.cs b/src/dotnet/commands/dotnet-clean/Program.cs index b93057290..fc9181c35 100644 --- a/src/dotnet/commands/dotnet-clean/Program.cs +++ b/src/dotnet/commands/dotnet-clean/Program.cs @@ -21,7 +21,7 @@ namespace Microsoft.DotNet.Tools.Clean { var msbuildArgs = new List { - "/v:normal" + "-v:normal" }; var parser = Parser.Instance; @@ -34,7 +34,7 @@ namespace Microsoft.DotNet.Tools.Clean msbuildArgs.AddRange(parsedClean.Arguments); - msbuildArgs.Add("/t:Clean"); + msbuildArgs.Add("-t:Clean"); msbuildArgs.AddRange(parsedClean.OptionValuesToBeForwarded()); diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs index 2ec0e183c..fce03a487 100644 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs @@ -33,7 +33,7 @@ namespace Microsoft.DotNet.Tools.MSBuild return argsToForward .Concat(new[] { - $"/distributedlogger:{loggerType.FullName},{loggerType.GetTypeInfo().Assembly.Location}*{forwardingLoggerType.FullName},{forwardingLoggerType.GetTypeInfo().Assembly.Location}" + $"-distributedlogger:{loggerType.FullName},{loggerType.GetTypeInfo().Assembly.Location}*{forwardingLoggerType.FullName},{forwardingLoggerType.GetTypeInfo().Assembly.Location}" }); } catch (Exception) diff --git a/src/dotnet/commands/dotnet-pack/PackCommand.cs b/src/dotnet/commands/dotnet-pack/PackCommand.cs index 6aa36b73e..d07abd033 100644 --- a/src/dotnet/commands/dotnet-pack/PackCommand.cs +++ b/src/dotnet/commands/dotnet-pack/PackCommand.cs @@ -36,7 +36,7 @@ namespace Microsoft.DotNet.Tools.Pack var msbuildArgs = new List() { - "/t:pack" + "-t:pack" }; msbuildArgs.AddRange(parsedPack.OptionValuesToBeForwarded()); diff --git a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs b/src/dotnet/commands/dotnet-pack/PackCommandParser.cs index 036e12072..c5cc170dd 100644 --- a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs +++ b/src/dotnet/commands/dotnet-pack/PackCommandParser.cs @@ -22,25 +22,25 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.CmdOutputDirDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) - .ForwardAsSingle(o => $"/p:PackageOutputPath={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:PackageOutputPath={o.Arguments.Single()}")), Create.Option( "--no-build", LocalizableStrings.CmdNoBuildOptionDescription, - Accept.NoArguments().ForwardAs("/p:NoBuild=true")), + Accept.NoArguments().ForwardAs("-p:NoBuild=true")), Create.Option( "--include-symbols", LocalizableStrings.CmdIncludeSymbolsDescription, - Accept.NoArguments().ForwardAs("/p:IncludeSymbols=true")), + Accept.NoArguments().ForwardAs("-p:IncludeSymbols=true")), Create.Option( "--include-source", LocalizableStrings.CmdIncludeSourceDescription, - Accept.NoArguments().ForwardAs("/p:IncludeSource=true")), + Accept.NoArguments().ForwardAs("-p:IncludeSource=true")), CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), Create.Option( "-s|--serviceable", LocalizableStrings.CmdServiceableDescription, - Accept.NoArguments().ForwardAs("/p:Serviceable=true")), + Accept.NoArguments().ForwardAs("-p:Serviceable=true")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); } diff --git a/src/dotnet/commands/dotnet-publish/Program.cs b/src/dotnet/commands/dotnet-publish/Program.cs index f44ecb2ca..ce140f833 100644 --- a/src/dotnet/commands/dotnet-publish/Program.cs +++ b/src/dotnet/commands/dotnet-publish/Program.cs @@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Publish result.ShowHelpOrErrorIfAppropriate(); - msbuildArgs.Add("/t:Publish"); + msbuildArgs.Add("-t:Publish"); var appliedPublishOption = result["dotnet"]["publish"]; diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index 9149c1dfd..fdb26da53 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -22,7 +22,7 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOption) - .ForwardAsSingle(o => $"/p:PublishDir={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:PublishDir={o.Arguments.Single()}")), CommonOptions.FrameworkOption(), CommonOptions.RuntimeOption(), CommonOptions.ConfigurationOption(), @@ -32,7 +32,7 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.ManifestOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.ManifestOption) - .ForwardAsSingle(o => $"/p:TargetManifestFiles={string.Join("%3B", o.Arguments)}")), + .ForwardAsSingle(o => $"-p:TargetManifestFiles={string.Join("%3B", o.Arguments)}")), Create.Option( "--self-contained", LocalizableStrings.SelfContainedOptionDescription, @@ -41,7 +41,7 @@ namespace Microsoft.DotNet.Cli .ForwardAsSingle(o => { string value = o.Arguments.Any() ? o.Arguments.Single() : "true"; - return $"/p:SelfContained={value}"; + return $"-p:SelfContained={value}"; })), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs index b432150c3..dd531419f 100644 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ b/src/dotnet/commands/dotnet-restore/Program.cs @@ -35,10 +35,10 @@ namespace Microsoft.DotNet.Tools.Restore if (noLogo) { - msbuildArgs.Add("/nologo"); + msbuildArgs.Add("-nologo"); } - msbuildArgs.Add("/t:Restore"); + msbuildArgs.Add("-t:Restore"); msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded()); diff --git a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index 46b17d0f3..d673000cf 100644 --- a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -47,51 +47,51 @@ namespace Microsoft.DotNet.Cli showHelp ? LocalizableStrings.CmdSourceOptionDescription : string.Empty, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.CmdSourceOption) - .ForwardAsSingle(o => $"/p:RestoreSources={string.Join("%3B", o.Arguments)}")), + .ForwardAsSingle(o => $"-p:RestoreSources={string.Join("%3B", o.Arguments)}")), Create.Option( useShortOptions ? "-r|--runtime" : "--runtime" , LocalizableStrings.CmdRuntimeOptionDescription, Accept.OneOrMoreArguments() .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: LocalizableStrings.CmdRuntimeOption) - .ForwardAsSingle(o => $"/p:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")), + .ForwardAsSingle(o => $"-p:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")), Create.Option( "--packages", showHelp ? LocalizableStrings.CmdPackagesOptionDescription : string.Empty, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdPackagesOption) - .ForwardAsSingle(o => $"/p:RestorePackagesPath={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:RestorePackagesPath={o.Arguments.Single()}")), Create.Option( "--disable-parallel", showHelp ? LocalizableStrings.CmdDisableParallelOptionDescription : string.Empty, Accept.NoArguments() - .ForwardAs("/p:RestoreDisableParallel=true")), + .ForwardAs("-p:RestoreDisableParallel=true")), Create.Option( "--configfile", showHelp ? LocalizableStrings.CmdConfigFileOptionDescription : string.Empty, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdConfigFileOption) - .ForwardAsSingle(o => $"/p:RestoreConfigFile={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:RestoreConfigFile={o.Arguments.Single()}")), Create.Option( "--no-cache", showHelp ? LocalizableStrings.CmdNoCacheOptionDescription : string.Empty, Accept.NoArguments() - .ForwardAs("/p:RestoreNoCache=true")), + .ForwardAs("-p:RestoreNoCache=true")), Create.Option( "--ignore-failed-sources", showHelp ? LocalizableStrings.CmdIgnoreFailedSourcesOptionDescription : string.Empty, Accept.NoArguments() - .ForwardAs("/p:RestoreIgnoreFailedSources=true")), + .ForwardAs("-p:RestoreIgnoreFailedSources=true")), Create.Option( "--no-dependencies", LocalizableStrings.CmdNoDependenciesOptionDescription, Accept.NoArguments() - .ForwardAs("/p:RestoreRecursive=false")), + .ForwardAs("-p:RestoreRecursive=false")), Create.Option( useShortOptions ? "-f|--force" : "--force", LocalizableStrings.CmdForceRestoreOptionDescription, Accept.NoArguments() - .ForwardAs("/p:RestoreForce=true")) + .ForwardAs("-p:RestoreForce=true")) }; } } diff --git a/src/dotnet/commands/dotnet-run/RunCommand.cs b/src/dotnet/commands/dotnet-run/RunCommand.cs index 8534c39d1..2c7d20f51 100644 --- a/src/dotnet/commands/dotnet-run/RunCommand.cs +++ b/src/dotnet/commands/dotnet-run/RunCommand.cs @@ -167,12 +167,12 @@ namespace Microsoft.DotNet.Tools.Run { List args = new List() { - "/nologo" + "-nologo" }; - if (!RestoreArgs.Any(a => a.StartsWith("/verbosity:"))) + if (!RestoreArgs.Any(a => a.StartsWith("-verbosity:"))) { - args.Add("/verbosity:quiet"); + args.Add("-verbosity:quiet"); } args.AddRange(RestoreArgs); diff --git a/src/dotnet/commands/dotnet-store/Program.cs b/src/dotnet/commands/dotnet-store/Program.cs index 1f065c63e..78b47830b 100644 --- a/src/dotnet/commands/dotnet-store/Program.cs +++ b/src/dotnet/commands/dotnet-store/Program.cs @@ -34,7 +34,7 @@ namespace Microsoft.DotNet.Tools.Store throw new GracefulException(LocalizableStrings.SpecifyManifests); } - msbuildArgs.Add("/t:ComposeStore"); + msbuildArgs.Add("-t:ComposeStore"); msbuildArgs.AddRange(appliedBuildOptions.OptionValuesToBeForwarded()); diff --git a/src/dotnet/commands/dotnet-store/StoreCommandParser.cs b/src/dotnet/commands/dotnet-store/StoreCommandParser.cs index a5b7baafa..e0e7305b5 100644 --- a/src/dotnet/commands/dotnet-store/StoreCommandParser.cs +++ b/src/dotnet/commands/dotnet-store/StoreCommandParser.cs @@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Cli return new[] { materializedString, - $"/p:AdditionalProjects={string.Join("%3B", o.Arguments.Skip(1))}" + $"-p:AdditionalProjects={string.Join("%3B", o.Arguments.Skip(1))}" }; } })), @@ -47,30 +47,30 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.FrameworkVersionOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.FrameworkVersionOption) - .ForwardAsSingle(o => $"/p:RuntimeFrameworkVersion={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:RuntimeFrameworkVersion={o.Arguments.Single()}")), CommonOptions.RuntimeOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOption) - .ForwardAsSingle(o => $"/p:ComposeDir={Path.GetFullPath(o.Arguments.Single())}")), + .ForwardAsSingle(o => $"-p:ComposeDir={Path.GetFullPath(o.Arguments.Single())}")), Create.Option( "-w|--working-dir", LocalizableStrings.IntermediateWorkingDirOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.IntermediateWorkingDirOption) - .ForwardAsSingle(o => $"/p:ComposeWorkingDir={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:ComposeWorkingDir={o.Arguments.Single()}")), Create.Option( "--skip-optimization", LocalizableStrings.SkipOptimizationOptionDescription, Accept.NoArguments() - .ForwardAs("/p:SkipOptimization=true")), + .ForwardAs("-p:SkipOptimization=true")), Create.Option( "--skip-symbols", LocalizableStrings.SkipSymbolsOptionDescription, Accept.NoArguments() - .ForwardAs("/p:CreateProfilingSymbols=false")), + .ForwardAs("-p:CreateProfilingSymbols=false")), CommonOptions.VerbosityOption()); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/Program.cs b/src/dotnet/commands/dotnet-test/Program.cs index c8a9d41d4..ad2a42295 100644 --- a/src/dotnet/commands/dotnet-test/Program.cs +++ b/src/dotnet/commands/dotnet-test/Program.cs @@ -30,10 +30,10 @@ namespace Microsoft.DotNet.Tools.Test { var msbuildArgs = new List() { - "/t:VSTest", - "/v:quiet", - "/nodereuse:false", // workaround for https://github.com/Microsoft/vstest/issues/1503 - "/nologo" + "-t:VSTest", + "-v:quiet", + "-nodereuse:false", // workaround for https://github.com/Microsoft/vstest/issues/1503 + "-nologo" }; var parser = Parser.Instance; @@ -57,17 +57,17 @@ namespace Microsoft.DotNet.Tools.Test { var runSettingsArg = string.Join(";", runSettingsOptions); - msbuildArgs.Add($"/p:VSTestCLIRunSettings=\"{runSettingsArg}\""); + msbuildArgs.Add($"-p:VSTestCLIRunSettings=\"{runSettingsArg}\""); } - var verbosityArg = msbuildArgs.LastOrDefault(arg => arg.StartsWith("/verbosity")); + var verbosityArg = msbuildArgs.LastOrDefault(arg => arg.StartsWith("-verbosity")); if (!string.IsNullOrEmpty(verbosityArg)) { var verbosity = verbosityArg.Split(':'); if (verbosity.Length == 2) { - msbuildArgs.Add($"/p:VSTestVerbosity={verbosity[1]}"); + msbuildArgs.Add($"-p:VSTestVerbosity={verbosity[1]}"); } } diff --git a/src/dotnet/commands/dotnet-test/TestCommandParser.cs b/src/dotnet/commands/dotnet-test/TestCommandParser.cs index d6dc05df8..a796f9520 100644 --- a/src/dotnet/commands/dotnet-test/TestCommandParser.cs +++ b/src/dotnet/commands/dotnet-test/TestCommandParser.cs @@ -25,24 +25,24 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.CmdSettingsDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdSettingsFile) - .ForwardAsSingle(o => $"/p:VSTestSetting={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:VSTestSetting={o.Arguments.Single()}")), Create.Option( "-t|--list-tests", LocalizableStrings.CmdListTestsDescription, Accept.NoArguments() - .ForwardAsSingle(o => "/p:VSTestListTests=true")), + .ForwardAsSingle(o => "-p:VSTestListTests=true")), Create.Option( "--filter", LocalizableStrings.CmdTestCaseFilterDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdTestCaseFilterExpression) - .ForwardAsSingle(o => $"/p:VSTestTestCaseFilter={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:VSTestTestCaseFilter={o.Arguments.Single()}")), Create.Option( "-a|--test-adapter-path", LocalizableStrings.CmdTestAdapterPathDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdTestAdapterPath) - .ForwardAsSingle(o => $"/p:VSTestTestAdapterPath={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:VSTestTestAdapterPath={o.Arguments.Single()}")), Create.Option( "-l|--logger", LocalizableStrings.CmdLoggerDescription, @@ -52,7 +52,7 @@ namespace Microsoft.DotNet.Cli { var loggersString = string.Join(";", GetSemiColonEscapedArgs(o.Arguments)); - return $"/p:VSTestLogger={loggersString}"; + return $"-p:VSTestLogger={loggersString}"; })), CommonOptions.ConfigurationOption(), CommonOptions.FrameworkOption(), @@ -61,35 +61,35 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.CmdOutputDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) - .ForwardAsSingle(o => $"/p:OutputPath={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:OutputPath={o.Arguments.Single()}")), Create.Option( "-d|--diag", LocalizableStrings.CmdPathTologFileDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdPathToLogFile) - .ForwardAsSingle(o => $"/p:VSTestDiag={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:VSTestDiag={o.Arguments.Single()}")), Create.Option( "--no-build", LocalizableStrings.CmdNoBuildDescription, Accept.NoArguments() - .ForwardAsSingle(o => "/p:VSTestNoBuild=true")), + .ForwardAsSingle(o => "-p:VSTestNoBuild=true")), Create.Option( "-r|--results-directory", LocalizableStrings.CmdResultsDirectoryDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdPathToResultsDirectory) - .ForwardAsSingle(o => $"/p:VSTestResultsDirectory={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-p:VSTestResultsDirectory={o.Arguments.Single()}")), Create.Option( "--collect", LocalizableStrings.cmdCollectDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.cmdCollectFriendlyName) - .ForwardAsSingle(o => $"/p:VSTestCollect=\"{string.Join(";", o.Arguments)}\"")), + .ForwardAsSingle(o => $"-p:VSTestCollect=\"{string.Join(";", o.Arguments)}\"")), Create.Option( "--blame", LocalizableStrings.CmdBlameDescription, Accept.NoArguments() - .ForwardAsSingle(o => "/p:VSTestBlame=true")), + .ForwardAsSingle(o => "-p:VSTestBlame=true")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); diff --git a/src/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs b/src/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs index dd05db478..316c56b44 100644 --- a/src/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs +++ b/src/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs @@ -44,10 +44,10 @@ namespace Microsoft.DotNet.Tools.Tool.Install { "--runtime", AnyRid, - $"/p:BaseIntermediateOutputPath={assetJsonOutput.ToXmlEncodeString()}" + $"-p:BaseIntermediateOutputPath={assetJsonOutput.ToXmlEncodeString()}" }); - argsToPassToRestore.Add($"/verbosity:{verbosity ?? "quiet"}"); + argsToPassToRestore.Add($"-verbosity:{verbosity ?? "quiet"}"); var command = new DotNetCommandFactory(alwaysRunOutOfProc: true) .Create("restore", argsToPassToRestore); diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs index 129080b8e..93a3ff119 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs @@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return null; } - return $"/p:RuntimeIdentifier={_runtime}"; + return $"-p:RuntimeIdentifier={_runtime}"; } } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs index cc5804a1a..e5649209e 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs @@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return null; } - return $"/p:RuntimeIdentifier={_runtime}"; + return $"-p:RuntimeIdentifier={_runtime}"; } } } diff --git a/test/dotnet-msbuild.Tests/GivenDotnetBuildInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetBuildInvocation.cs index 742e4acb9..383016043 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetBuildInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetBuildInvocation.cs @@ -12,22 +12,22 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests const string ExpectedPrefix = "exec -m -v:m"; [Theory] - [InlineData(new string[] { }, "/t:Build")] - [InlineData(new string[] { "-o", "foo" }, "/t:Build /p:OutputPath=foo")] - [InlineData(new string[] { "-p:Verbosity=diag" }, "/t:Build -p:Verbosity=diag")] - [InlineData(new string[] { "--output", "foo" }, "/t:Build /p:OutputPath=foo")] - [InlineData(new string[] { "-o", "foo1 foo2" }, "/t:Build \"/p:OutputPath=foo1 foo2\"")] - [InlineData(new string[] { "--no-incremental" }, "/t:Rebuild")] - [InlineData(new string[] { "-r", "rid" }, "/t:Build /p:RuntimeIdentifier=rid")] - [InlineData(new string[] { "--runtime", "rid" }, "/t:Build /p:RuntimeIdentifier=rid")] - [InlineData(new string[] { "-c", "config" }, "/t:Build /p:Configuration=config")] - [InlineData(new string[] { "--configuration", "config" }, "/t:Build /p:Configuration=config")] - [InlineData(new string[] { "--version-suffix", "mysuffix" }, "/t:Build /p:VersionSuffix=mysuffix")] - [InlineData(new string[] { "--no-dependencies" }, "/t:Build /p:BuildProjectReferences=false")] - [InlineData(new string[] { "-v", "diag" }, "/t:Build /verbosity:diag")] - [InlineData(new string[] { "--verbosity", "diag" }, "/t:Build /verbosity:diag")] + [InlineData(new string[] { }, "-t:Build")] + [InlineData(new string[] { "-o", "foo" }, "-t:Build -p:OutputPath=foo")] + [InlineData(new string[] { "-p:Verbosity=diag" }, "-t:Build -p:Verbosity=diag")] + [InlineData(new string[] { "--output", "foo" }, "-t:Build -p:OutputPath=foo")] + [InlineData(new string[] { "-o", "foo1 foo2" }, "-t:Build \"-p:OutputPath=foo1 foo2\"")] + [InlineData(new string[] { "--no-incremental" }, "-t:Rebuild")] + [InlineData(new string[] { "-r", "rid" }, "-t:Build -p:RuntimeIdentifier=rid")] + [InlineData(new string[] { "--runtime", "rid" }, "-t:Build -p:RuntimeIdentifier=rid")] + [InlineData(new string[] { "-c", "config" }, "-t:Build -p:Configuration=config")] + [InlineData(new string[] { "--configuration", "config" }, "-t:Build -p:Configuration=config")] + [InlineData(new string[] { "--version-suffix", "mysuffix" }, "-t:Build -p:VersionSuffix=mysuffix")] + [InlineData(new string[] { "--no-dependencies" }, "-t:Build -p:BuildProjectReferences=false")] + [InlineData(new string[] { "-v", "diag" }, "-t:Build -verbosity:diag")] + [InlineData(new string[] { "--verbosity", "diag" }, "-t:Build -verbosity:diag")] [InlineData(new string[] { "--no-incremental", "-o", "myoutput", "-r", "myruntime", "-v", "diag", "/ArbitrarySwitchForMSBuild" }, - "/t:Rebuild /p:OutputPath=myoutput /p:RuntimeIdentifier=myruntime /verbosity:diag /ArbitrarySwitchForMSBuild")] + "-t:Rebuild -p:OutputPath=myoutput -p:RuntimeIdentifier=myruntime -verbosity:diag /ArbitrarySwitchForMSBuild")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) { expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); @@ -39,14 +39,14 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests command.GetProcessStartInfo() .Arguments.Should() - .Be($"{ExpectedPrefix} /restore /clp:Summary{expectedAdditionalArgs}"); + .Be($"{ExpectedPrefix} -restore -clp:Summary{expectedAdditionalArgs}"); } [Theory] - [InlineData(new string[] { "-f", "tfm" }, "/t:Restore", "/t:Build /p:TargetFramework=tfm")] + [InlineData(new string[] { "-f", "tfm" }, "-t:Restore", "-t:Build -p:TargetFramework=tfm")] [InlineData(new string[] { "-o", "myoutput", "-f", "tfm", "-v", "diag", "/ArbitrarySwitchForMSBuild" }, - "/t:Restore /p:OutputPath=myoutput /verbosity:diag /ArbitrarySwitchForMSBuild", - "/t:Build /p:OutputPath=myoutput /p:TargetFramework=tfm /verbosity:diag /ArbitrarySwitchForMSBuild")] + "-t:Restore -p:OutputPath=myoutput -verbosity:diag /ArbitrarySwitchForMSBuild", + "-t:Build -p:OutputPath=myoutput -p:TargetFramework=tfm -verbosity:diag /ArbitrarySwitchForMSBuild")] public void MsbuildInvocationIsCorrectForSeparateRestore( string[] args, string expectedAdditionalArgsForRestore, @@ -63,7 +63,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests command.GetProcessStartInfo() .Arguments.Should() - .Be($"{ExpectedPrefix} /nologo /clp:Summary{expectedAdditionalArgs}"); + .Be($"{ExpectedPrefix} -nologo -clp:Summary{expectedAdditionalArgs}"); } } diff --git a/test/dotnet-msbuild.Tests/GivenDotnetCleanInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetCleanInvocation.cs index 74ad73a41..9ed9d7c05 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetCleanInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetCleanInvocation.cs @@ -10,26 +10,26 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { public class GivenDotnetCleanInvocation { - const string ExpectedPrefix = "exec -m -v:m /v:normal /t:Clean"; + const string ExpectedPrefix = "exec -m -v:m -v:normal -t:Clean"; [Fact] public void ItAddsProjectToMsbuildInvocation() { var msbuildPath = ""; CleanCommand.FromArgs(new string[] { "" }, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be("exec -m -v:m /v:normal /t:Clean"); + .GetProcessStartInfo().Arguments.Should().Be("exec -m -v:m -v:normal -t:Clean"); } [Theory] [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-o", "" }, "/p:OutputPath=")] - [InlineData(new string[] { "--output", "" }, "/p:OutputPath=")] - [InlineData(new string[] { "-f", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "-v", "diag" }, "/verbosity:diag")] - [InlineData(new string[] { "--verbosity", "diag" }, "/verbosity:diag")] + [InlineData(new string[] { "-o", "" }, "-p:OutputPath=")] + [InlineData(new string[] { "--output", "" }, "-p:OutputPath=")] + [InlineData(new string[] { "-f", "" }, "-p:TargetFramework=")] + [InlineData(new string[] { "--framework", "" }, "-p:TargetFramework=")] + [InlineData(new string[] { "-c", "" }, "-p:Configuration=")] + [InlineData(new string[] { "--configuration", "" }, "-p:Configuration=")] + [InlineData(new string[] { "-v", "diag" }, "-verbosity:diag")] + [InlineData(new string[] { "--verbosity", "diag" }, "-verbosity:diag")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) { expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); diff --git a/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs b/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs index e4c789ede..c71c8518a 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs @@ -138,7 +138,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests allArgs.Should().NotBeNull(); allArgs.Should().Contain( - value => value.IndexOf("/distributedlogger", StringComparison.OrdinalIgnoreCase) >= 0, + value => value.IndexOf("-distributedlogger", StringComparison.OrdinalIgnoreCase) >= 0, "The MSBuild logger argument should be specified when telemetry is enabled."); } } @@ -151,7 +151,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests allArgs.Should().NotBeNull(); allArgs.Should().NotContain( - value => value.IndexOf("/Logger", StringComparison.OrdinalIgnoreCase) >= 0, + value => value.IndexOf("-logger", StringComparison.OrdinalIgnoreCase) >= 0, $"The MSBuild logger argument should not be specified when telemetry is disabled."); } diff --git a/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs index cff9e2c76..680389b01 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs @@ -11,23 +11,23 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { public class GivenDotnetPackInvocation { - const string ExpectedPrefix = "exec -m -v:m /restore /t:pack"; - const string ExpectedNoBuildPrefix = "exec -m -v:m /t:pack"; + const string ExpectedPrefix = "exec -m -v:m -restore -t:pack"; + const string ExpectedNoBuildPrefix = "exec -m -v:m -t:pack"; [Theory] [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-o", "" }, "/p:PackageOutputPath=")] - [InlineData(new string[] { "--output", "" }, "/p:PackageOutputPath=")] - [InlineData(new string[] { "--no-build" }, "/p:NoBuild=true")] - [InlineData(new string[] { "--include-symbols" }, "/p:IncludeSymbols=true")] - [InlineData(new string[] { "--include-source" }, "/p:IncludeSource=true")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--version-suffix", "" }, "/p:VersionSuffix=")] - [InlineData(new string[] { "-s" }, "/p:Serviceable=true")] - [InlineData(new string[] { "--serviceable" }, "/p:Serviceable=true")] - [InlineData(new string[] { "-v", "diag" }, "/verbosity:diag")] - [InlineData(new string[] { "--verbosity", "diag" }, "/verbosity:diag")] + [InlineData(new string[] { "-o", "" }, "-p:PackageOutputPath=")] + [InlineData(new string[] { "--output", "" }, "-p:PackageOutputPath=")] + [InlineData(new string[] { "--no-build" }, "-p:NoBuild=true")] + [InlineData(new string[] { "--include-symbols" }, "-p:IncludeSymbols=true")] + [InlineData(new string[] { "--include-source" }, "-p:IncludeSource=true")] + [InlineData(new string[] { "-c", "" }, "-p:Configuration=")] + [InlineData(new string[] { "--configuration", "" }, "-p:Configuration=")] + [InlineData(new string[] { "--version-suffix", "" }, "-p:VersionSuffix=")] + [InlineData(new string[] { "-s" }, "-p:Serviceable=true")] + [InlineData(new string[] { "--serviceable" }, "-p:Serviceable=true")] + [InlineData(new string[] { "-v", "diag" }, "-verbosity:diag")] + [InlineData(new string[] { "--verbosity", "diag" }, "-verbosity:diag")] [InlineData(new string[] { "" }, "")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) { diff --git a/test/dotnet-msbuild.Tests/GivenDotnetPublishInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetPublishInvocation.cs index 1a8a57ee8..d02c96718 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetPublishInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetPublishInvocation.cs @@ -24,16 +24,16 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests [Theory] [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-r", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--runtime", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "-o", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "--output", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--version-suffix", "" }, "/p:VersionSuffix=")] - [InlineData(new string[] { "--manifest", "" }, "/p:TargetManifestFiles=")] - [InlineData(new string[] { "-v", "minimal" }, "/verbosity:minimal")] - [InlineData(new string[] { "--verbosity", "minimal" }, "/verbosity:minimal")] + [InlineData(new string[] { "-r", "" }, "-p:RuntimeIdentifier=")] + [InlineData(new string[] { "--runtime", "" }, "-p:RuntimeIdentifier=")] + [InlineData(new string[] { "-o", "" }, "-p:PublishDir=")] + [InlineData(new string[] { "--output", "" }, "-p:PublishDir=")] + [InlineData(new string[] { "-c", "" }, "-p:Configuration=")] + [InlineData(new string[] { "--configuration", "" }, "-p:Configuration=")] + [InlineData(new string[] { "--version-suffix", "" }, "-p:VersionSuffix=")] + [InlineData(new string[] { "--manifest", "" }, "-p:TargetManifestFiles=")] + [InlineData(new string[] { "-v", "minimal" }, "-verbosity:minimal")] + [InlineData(new string[] { "--verbosity", "minimal" }, "-verbosity:minimal")] [InlineData(new string[] { "" }, "")] [InlineData(new string[] { "", "" }, " ")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) @@ -49,12 +49,12 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests command.GetProcessStartInfo() .Arguments.Should() - .Be($"{ExpectedPrefix} /restore /t:Publish{expectedAdditionalArgs}"); + .Be($"{ExpectedPrefix} -restore -t:Publish{expectedAdditionalArgs}"); } [Theory] - [InlineData(new string[] { "-f", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, "/p:TargetFramework=")] + [InlineData(new string[] { "-f", "" }, "-p:TargetFramework=")] + [InlineData(new string[] { "--framework", "" }, "-p:TargetFramework=")] public void MsbuildInvocationIsCorrectForSeparateRestore(string[] args, string expectedAdditionalArgs) { expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); @@ -65,27 +65,27 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests command.SeparateRestoreCommand .GetProcessStartInfo() .Arguments.Should() - .Be($"{ExpectedPrefix} /t:Restore"); + .Be($"{ExpectedPrefix} -t:Restore"); command.GetProcessStartInfo() .Arguments.Should() - .Be($"{ExpectedPrefix} /nologo /t:Publish{expectedAdditionalArgs}"); + .Be($"{ExpectedPrefix} -nologo -t:Publish{expectedAdditionalArgs}"); } [Theory] [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-f", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "-r", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--runtime", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "-o", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "--output", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--version-suffix", "" }, "/p:VersionSuffix=")] - [InlineData(new string[] { "--manifest", "" }, "/p:TargetManifestFiles=")] - [InlineData(new string[] { "-v", "minimal" }, "/verbosity:minimal")] - [InlineData(new string[] { "--verbosity", "minimal" }, "/verbosity:minimal")] + [InlineData(new string[] { "-f", "" }, "-p:TargetFramework=")] + [InlineData(new string[] { "--framework", "" }, "-p:TargetFramework=")] + [InlineData(new string[] { "-r", "" }, "-p:RuntimeIdentifier=")] + [InlineData(new string[] { "--runtime", "" }, "-p:RuntimeIdentifier=")] + [InlineData(new string[] { "-o", "" }, "-p:PublishDir=")] + [InlineData(new string[] { "--output", "" }, "-p:PublishDir=")] + [InlineData(new string[] { "-c", "" }, "-p:Configuration=")] + [InlineData(new string[] { "--configuration", "" }, "-p:Configuration=")] + [InlineData(new string[] { "--version-suffix", "" }, "-p:VersionSuffix=")] + [InlineData(new string[] { "--manifest", "" }, "-p:TargetManifestFiles=")] + [InlineData(new string[] { "-v", "minimal" }, "-verbosity:minimal")] + [InlineData(new string[] { "--verbosity", "minimal" }, "-verbosity:minimal")] public void OptionForwardingIsCorrect(string[] args, string expectedAdditionalArgs) { var expectedArgs = expectedAdditionalArgs.Split(' ', StringSplitOptions.RemoveEmptyEntries); diff --git a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs index 1735d42e8..9cfa9d00e 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs @@ -11,24 +11,24 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests public class GivenDotnetRestoreInvocation { private const string ExpectedPrefix = - "exec -m -v:m /nologo /t:Restore"; + "exec -m -v:m -nologo -t:Restore"; [Theory] [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-s", "" }, "/p:RestoreSources=")] - [InlineData(new string[] { "--source", "" }, "/p:RestoreSources=")] - [InlineData(new string[] { "-s", "", "-s", "" }, "/p:RestoreSources=%3B")] - [InlineData(new string[] { "-r", "" }, "/p:RuntimeIdentifiers=")] - [InlineData(new string[] { "--runtime", "" }, "/p:RuntimeIdentifiers=")] - [InlineData(new string[] { "-r", "", "-r", "" }, "/p:RuntimeIdentifiers=%3B")] - [InlineData(new string[] { "--packages", "" }, "/p:RestorePackagesPath=")] - [InlineData(new string[] { "--disable-parallel" }, "/p:RestoreDisableParallel=true")] - [InlineData(new string[] { "--configfile", "" }, "/p:RestoreConfigFile=")] - [InlineData(new string[] { "--no-cache" }, "/p:RestoreNoCache=true")] - [InlineData(new string[] { "--ignore-failed-sources" }, "/p:RestoreIgnoreFailedSources=true")] - [InlineData(new string[] { "--no-dependencies" }, "/p:RestoreRecursive=false")] - [InlineData(new string[] { "-v", "minimal" }, @"/verbosity:minimal")] - [InlineData(new string[] { "--verbosity", "minimal" }, @"/verbosity:minimal")] + [InlineData(new string[] { "-s", "" }, "-p:RestoreSources=")] + [InlineData(new string[] { "--source", "" }, "-p:RestoreSources=")] + [InlineData(new string[] { "-s", "", "-s", "" }, "-p:RestoreSources=%3B")] + [InlineData(new string[] { "-r", "" }, "-p:RuntimeIdentifiers=")] + [InlineData(new string[] { "--runtime", "" }, "-p:RuntimeIdentifiers=")] + [InlineData(new string[] { "-r", "", "-r", "" }, "-p:RuntimeIdentifiers=%3B")] + [InlineData(new string[] { "--packages", "" }, "-p:RestorePackagesPath=")] + [InlineData(new string[] { "--disable-parallel" }, "-p:RestoreDisableParallel=true")] + [InlineData(new string[] { "--configfile", "" }, "-p:RestoreConfigFile=")] + [InlineData(new string[] { "--no-cache" }, "-p:RestoreNoCache=true")] + [InlineData(new string[] { "--ignore-failed-sources" }, "-p:RestoreIgnoreFailedSources=true")] + [InlineData(new string[] { "--no-dependencies" }, "-p:RestoreRecursive=false")] + [InlineData(new string[] { "-v", "minimal" }, @"-verbosity:minimal")] + [InlineData(new string[] { "--verbosity", "minimal" }, @"-verbosity:minimal")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) { expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); diff --git a/test/dotnet-msbuild.Tests/GivenDotnetStoreInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetStoreInvocation.cs index bb31b655a..1017cd5d1 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetStoreInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetStoreInvocation.cs @@ -11,7 +11,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { public class GivenDotnetStoreInvocation { - const string ExpectedPrefix = "exec -m -v:m /t:ComposeStore "; + const string ExpectedPrefix = "exec -m -v:m -t:ComposeStore "; static readonly string[] ArgsPrefix = { "-m", "" }; [Theory] @@ -26,11 +26,11 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests } [Theory] - [InlineData(new string[] { "-f", "" }, @"/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, @"/p:TargetFramework=")] - [InlineData(new string[] { "-r", "" }, @"/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--runtime", "" }, @"/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--manifest", "one.xml", "--manifest", "two.xml", "--manifest", "three.xml" }, @"/p:AdditionalProjects=one.xml%3Btwo.xml%3Bthree.xml")] + [InlineData(new string[] { "-f", "" }, @"-p:TargetFramework=")] + [InlineData(new string[] { "--framework", "" }, @"-p:TargetFramework=")] + [InlineData(new string[] { "-r", "" }, @"-p:RuntimeIdentifier=")] + [InlineData(new string[] { "--runtime", "" }, @"-p:RuntimeIdentifier=")] + [InlineData(new string[] { "--manifest", "one.xml", "--manifest", "two.xml", "--manifest", "three.xml" }, @"-p:AdditionalProjects=one.xml%3Btwo.xml%3Bthree.xml")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) { args = ArgsPrefix.Concat(args).ToArray(); @@ -51,7 +51,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests var msbuildPath = ""; StoreCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix} /p:ComposeDir={Path.GetFullPath(path)}"); + .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix} -p:ComposeDir={Path.GetFullPath(path)}"); } } }