From cbfcba902d9ac0aa03b48e1a41d202cac196f7d6 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 12 Aug 2021 13:00:51 +0800 Subject: [PATCH 1/3] Add '-s' for self contained --- src/Cli/dotnet/CommonOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index c51a035147ed..374bf499a7a2 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -111,7 +111,7 @@ public static Option OperatingSystemOption() => public static Option SelfContainedOption() => new ForwardedOption( - "--self-contained", + new string[] { "-s", "--self-contained" }, CommonLocalizableStrings.SelfContainedOptionDescription) .ForwardAsMany(o => new string[] { $"-property:SelfContained={o}", "-property:_CommandLineDefinedSelfContained=true" }); From a7cd4f8c6297c0b667d797c131d37ca87dda5ef0 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 12 Aug 2021 23:54:56 +0000 Subject: [PATCH 2/3] Add test case for -s flag --- .../GivenDotnetPublishPublishesProjects.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 579d1604b860..5258434c552a 100644 --- a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -98,7 +98,9 @@ public void ItDoesNotImplicitlyRestoreAProjectWhenPublishingWithTheNoRestoreOpti [Theory] [InlineData(null)] + [InlineData("-s")] [InlineData("--self-contained")] + [InlineData("-s=true")] [InlineData("--self-contained=true")] public void ItPublishesSelfContainedWithRid(string args) { @@ -115,6 +117,7 @@ public void ItPublishesSelfContainedWithRid(string args) } [Theory] + [InlineData("-s=false")] [InlineData("--self-contained=false")] [InlineData("--no-self-contained")] public void ItPublishesFrameworkDependentWithRid(string args) @@ -142,6 +145,7 @@ public void ItPublishesFrameworkDependentWithRid(string args) } [Theory] + [InlineData("-s=false")] [InlineData("--self-contained=false")] [InlineData(null)] [InlineData("--no-self-contained")] @@ -165,7 +169,9 @@ public void ItPublishesFrameworkDependentWithoutRid(string args) } [Theory] + [InlineData("-s --no-self-contained")] [InlineData("--self-contained --no-self-contained")] + [InlineData("-s=true --no-self-contained")] [InlineData("--self-contained=true --no-self-contained")] public void ItFailsToPublishWithConflictingArgument(string args) { From ac6eb8a22862eeb57e56aa500cb461c836167268 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 17 Aug 2021 05:09:09 +0000 Subject: [PATCH 3/3] Use '--sc' instead of '-s' --- src/Cli/dotnet/CommonOptions.cs | 2 +- .../GivenDotnetPublishPublishesProjects.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index 374bf499a7a2..26fdeceed775 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -111,7 +111,7 @@ public static Option OperatingSystemOption() => public static Option SelfContainedOption() => new ForwardedOption( - new string[] { "-s", "--self-contained" }, + new string[] { "--sc", "--self-contained" }, CommonLocalizableStrings.SelfContainedOptionDescription) .ForwardAsMany(o => new string[] { $"-property:SelfContained={o}", "-property:_CommandLineDefinedSelfContained=true" }); diff --git a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 5258434c552a..d1a934a45894 100644 --- a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -98,9 +98,9 @@ public void ItDoesNotImplicitlyRestoreAProjectWhenPublishingWithTheNoRestoreOpti [Theory] [InlineData(null)] - [InlineData("-s")] + [InlineData("--sc")] [InlineData("--self-contained")] - [InlineData("-s=true")] + [InlineData("--sc=true")] [InlineData("--self-contained=true")] public void ItPublishesSelfContainedWithRid(string args) { @@ -117,7 +117,7 @@ public void ItPublishesSelfContainedWithRid(string args) } [Theory] - [InlineData("-s=false")] + [InlineData("--sc=false")] [InlineData("--self-contained=false")] [InlineData("--no-self-contained")] public void ItPublishesFrameworkDependentWithRid(string args) @@ -145,7 +145,7 @@ public void ItPublishesFrameworkDependentWithRid(string args) } [Theory] - [InlineData("-s=false")] + [InlineData("--sc=false")] [InlineData("--self-contained=false")] [InlineData(null)] [InlineData("--no-self-contained")] @@ -169,9 +169,9 @@ public void ItPublishesFrameworkDependentWithoutRid(string args) } [Theory] - [InlineData("-s --no-self-contained")] + [InlineData("--sc --no-self-contained")] [InlineData("--self-contained --no-self-contained")] - [InlineData("-s=true --no-self-contained")] + [InlineData("--sc=true --no-self-contained")] [InlineData("--self-contained=true --no-self-contained")] public void ItFailsToPublishWithConflictingArgument(string args) {