diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 9655cf67b..b19307f20 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -1574,7 +1574,7 @@ Global {F2D1A7DA-B3EB-4CA7-BAA9-A18CEC398853} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3} {C98C7C2E-2C29-4A40-958C-60561ED77791} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {56F1E090-B80F-4BDF-8991-4B0F9B5B8C9A} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} - {CACA427D-5A71-45E6-88DC-3E2DB6C4D52D} = {FF498306-2DE2-47F6-8C35-3CF0589CF2B8} + {CACA427D-5A71-45E6-88DC-3E2DB6C4D52D} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {3275D006-54C8-4C64-A537-B9941C5D2F0C} = {89905EC4-BC0F-443B-8ADF-691321F10108} {DE4D1AEB-871B-4E7C-945A-453F9A490C06} = {89905EC4-BC0F-443B-8ADF-691321F10108} EndGlobalSection diff --git a/src/dotnet/BuiltInCommandsCatalog.cs b/src/dotnet/BuiltInCommandsCatalog.cs index 0e084971b..1d002dee8 100644 --- a/src/dotnet/BuiltInCommandsCatalog.cs +++ b/src/dotnet/BuiltInCommandsCatalog.cs @@ -1,5 +1,6 @@ -using System; -using System.Collections.Generic; +// 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 Microsoft.DotNet.Tools.Add; using Microsoft.DotNet.Tools.Build; using Microsoft.DotNet.Tools.Clean; @@ -15,9 +16,10 @@ using Microsoft.DotNet.Tools.Remove; using Microsoft.DotNet.Tools.Restore; using Microsoft.DotNet.Tools.Run; using Microsoft.DotNet.Tools.Sln; +using Microsoft.DotNet.Tools.Store; using Microsoft.DotNet.Tools.Test; using Microsoft.DotNet.Tools.VSTest; -using Microsoft.DotNet.Tools.Cache; +using System.Collections.Generic; namespace Microsoft.DotNet.Cli { @@ -37,12 +39,6 @@ namespace Microsoft.DotNet.Cli // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-build DocLink = "https://aka.ms/dotnet-build" }, - ["cache"] = new BuiltInCommandMetadata - { - Command = CacheCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-cache - DocLink = "https://aka.ms/dotnet-cache" - }, ["clean"] = new BuiltInCommandMetadata { Command = CleanCommand.Run, @@ -122,6 +118,12 @@ namespace Microsoft.DotNet.Cli // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-sln DocLink = "https://aka.ms/dotnet-sln" }, + ["store"] = new BuiltInCommandMetadata + { + Command = StoreCommand.Run, + // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-store + DocLink = "https://aka.ms/dotnet-store" + }, ["test"] = new BuiltInCommandMetadata { Command = TestCommand.Run, diff --git a/src/dotnet/Parser.cs b/src/dotnet/Parser.cs index fb15afd03..acfbfe9c6 100644 --- a/src/dotnet/Parser.cs +++ b/src/dotnet/Parser.cs @@ -46,7 +46,7 @@ namespace Microsoft.DotNet.Cli RemoveCommandParser.Remove(), ListCommandParser.List(), NuGetCommandParser.NuGet(), - CacheCommandParser.Cache(), + StoreCommandParser.Store(), Create.Command("msbuild", ""), Create.Command("vstest", ""), CompleteCommandParser.Complete(), diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs index ee9e9aba8..78b2e5861 100644 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs @@ -72,11 +72,6 @@ namespace Microsoft.DotNet.Tools.MSBuild return GetProcessStartInfo().Execute(); } - internal static CommandOption AddVerbosityOption(CommandLineApplication app) - { - return app.Option("-v|--verbosity", LocalizableStrings.VerbosityOptionDescription, CommandOptionType.SingleValue); - } - private static string Escape(string arg) => // this is a workaround for https://github.com/Microsoft/msbuild/issues/1622 (arg.StartsWith("/p:RestoreSources=", StringComparison.OrdinalIgnoreCase)) ? diff --git a/src/dotnet/commands/dotnet-publish/LocalizableStrings.cs b/src/dotnet/commands/dotnet-publish/LocalizableStrings.cs index c0b6d6a2f..b077da201 100644 --- a/src/dotnet/commands/dotnet-publish/LocalizableStrings.cs +++ b/src/dotnet/commands/dotnet-publish/LocalizableStrings.cs @@ -5,8 +5,6 @@ namespace Microsoft.DotNet.Tools.Publish { internal class LocalizableStrings { - public const string AppFullName = ".NET Publisher"; - public const string AppDescription = "Publisher for the .NET Platform"; public const string FrameworkOption = "FRAMEWORK"; @@ -17,9 +15,9 @@ namespace Microsoft.DotNet.Tools.Publish public const string OutputOptionDescription = "Output directory in which to place the published artifacts."; - public const string FilterProjOption = "profile.xml"; + public const string TargetOption = "target.xml"; - public const string FilterProjOptionDescription = "The XML file that contains the list of packages to be excluded from publish step."; + public const string TargetOptionDescription = "The path to a target manifest file that contains the list of packages to be excluded from the publish step."; public const string SelfContainedOptionDescription = "Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified."; } diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index 384b613cd..a70987958 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli public static Command Publish() => Create.Command( "publish", - LocalizableStrings.AppFullName, + LocalizableStrings.AppDescription, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), CommonOptions.FrameworkOption(), @@ -26,10 +26,10 @@ namespace Microsoft.DotNet.Cli CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), Create.Option( - "--filter", - LocalizableStrings.FilterProjOptionDescription, + "--target", + LocalizableStrings.TargetOptionDescription, Accept.OneOrMoreArguments() - .With(name: LocalizableStrings.FilterProjOption) + .With(name: LocalizableStrings.TargetOption) .ForwardAsSingle(o => $"/p:FilterProjectFiles={string.Join("%3B", o.Arguments)}")), Create.Option( "--self-contained", diff --git a/src/dotnet/commands/dotnet-cache/LocalizableStrings.cs b/src/dotnet/commands/dotnet-store/LocalizableStrings.cs similarity index 72% rename from src/dotnet/commands/dotnet-cache/LocalizableStrings.cs rename to src/dotnet/commands/dotnet-store/LocalizableStrings.cs index 156440ca6..a3b50523e 100644 --- a/src/dotnet/commands/dotnet-cache/LocalizableStrings.cs +++ b/src/dotnet/commands/dotnet-store/LocalizableStrings.cs @@ -1,21 +1,19 @@ // 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. -namespace Microsoft.DotNet.Tools.Cache +namespace Microsoft.DotNet.Tools.Store { internal class LocalizableStrings { - public const string AppFullName = ".NET Cache"; + public const string AppDescription = "Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework."; - public const string AppDescription = "Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework."; + public const string ProjectManifest = "PROJECT_MANIFEST"; - public const string ProjectEntries = "PROJECT_ENTRIES"; - - public const string ProjectEntryDescription = "The XML file that contains the list of packages to be cached."; + public const string ProjectManifestDescription = "The XML file that contains the list of packages to be stored."; public const string OutputOption = "OUTPUT_DIR"; - public const string OutputOptionDescription = "Output directory in which to cache the given assemblies."; + public const string OutputOptionDescription = "Output directory in which to store the given assemblies."; public const string FrameworkVersionOption = "FrameworkVersion"; @@ -29,7 +27,7 @@ namespace Microsoft.DotNet.Tools.Cache public const string PreserveIntermediateWorkingDirOptionDescription = "Preserves the intermediate working directory."; - public const string SpecifyEntries = "Specify at least one entry with --entries."; + public const string SpecifyManifests = "Specify at least one manifest with --manifest."; public const string IntermediateDirExists = "Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w."; } diff --git a/src/dotnet/commands/dotnet-cache/Program.cs b/src/dotnet/commands/dotnet-store/Program.cs similarity index 65% rename from src/dotnet/commands/dotnet-cache/Program.cs rename to src/dotnet/commands/dotnet-store/Program.cs index 64d70a169..5718635ab 100644 --- a/src/dotnet/commands/dotnet-cache/Program.cs +++ b/src/dotnet/commands/dotnet-store/Program.cs @@ -1,41 +1,37 @@ // 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.Collections.Generic; +using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Cli; -using System.Diagnostics; -using System; -using System.IO; -using System.Linq; +using System.Collections.Generic; using Parser = Microsoft.DotNet.Cli.Parser; -namespace Microsoft.DotNet.Tools.Cache +namespace Microsoft.DotNet.Tools.Store { - public partial class CacheCommand : MSBuildForwardingApp + public class StoreCommand : MSBuildForwardingApp { - private CacheCommand(IEnumerable msbuildArgs, string msbuildPath = null) + private StoreCommand(IEnumerable msbuildArgs, string msbuildPath = null) : base(msbuildArgs, msbuildPath) { } - public static CacheCommand FromArgs(string[] args, string msbuildPath = null) + public static StoreCommand FromArgs(string[] args, string msbuildPath = null) { var msbuildArgs = new List(); var parser = Parser.Instance; - var result = parser.ParseFrom("dotnet cache", args); + var result = parser.ParseFrom("dotnet store", args); result.ShowHelpOrErrorIfAppropriate(); - var appliedBuildOptions = result["dotnet"]["cache"]; + var appliedBuildOptions = result["dotnet"]["store"]; - if (!appliedBuildOptions.HasOption("-e")) + if (!appliedBuildOptions.HasOption("-m")) { - throw new InvalidOperationException(LocalizableStrings.SpecifyEntries); + throw new GracefulException(LocalizableStrings.SpecifyManifests); } msbuildArgs.Add("/t:ComposeCache"); @@ -44,14 +40,14 @@ namespace Microsoft.DotNet.Tools.Cache msbuildArgs.AddRange(appliedBuildOptions.Arguments); - return new CacheCommand(msbuildArgs, msbuildPath); + return new StoreCommand(msbuildArgs, msbuildPath); } public static int Run(string[] args) { DebugHelper.HandleDebugSwitch(ref args); - CacheCommand cmd; + StoreCommand cmd; try { cmd = FromArgs(args); diff --git a/src/dotnet/commands/dotnet-cache/CacheCommandParser.cs b/src/dotnet/commands/dotnet-store/StoreCommandParser.cs similarity index 92% rename from src/dotnet/commands/dotnet-cache/CacheCommandParser.cs rename to src/dotnet/commands/dotnet-store/StoreCommandParser.cs index 2643ec86c..341156fed 100644 --- a/src/dotnet/commands/dotnet-cache/CacheCommandParser.cs +++ b/src/dotnet/commands/dotnet-store/StoreCommandParser.cs @@ -4,23 +4,23 @@ using System.IO; using System.Linq; using Microsoft.DotNet.Cli.CommandLine; -using LocalizableStrings = Microsoft.DotNet.Tools.Cache.LocalizableStrings; +using LocalizableStrings = Microsoft.DotNet.Tools.Store.LocalizableStrings; namespace Microsoft.DotNet.Cli { - internal static class CacheCommandParser + internal static class StoreCommandParser { - public static Command Cache() => + public static Command Store() => Create.Command( - "cache", + "store", LocalizableStrings.AppDescription, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option( - "-e|--entries", - LocalizableStrings.ProjectEntryDescription, + "-m|--manifest", + LocalizableStrings.ProjectManifestDescription, Accept.OneOrMoreArguments() - .With(name: LocalizableStrings.ProjectEntries) + .With(name: LocalizableStrings.ProjectManifest) .ForwardAsMany(o => { var materializedString = $"{o.Arguments.First()}"; diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.cs.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.de.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.es.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.fr.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.it.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.ja.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.ko.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.pl.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.pt-BR.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.ru.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.tr.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.zh-Hans.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf diff --git a/src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf similarity index 100% rename from src/dotnet/commands/dotnet-cache/xlf/LocalizableStrings.zh-Hant.xlf rename to src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf