Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/DependencyVersions.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<MicrosoftNETCoreCompilersPackageVersion>$(MicrosoftCodeAnalysisCSharpPackageVersion)</MicrosoftNETCoreCompilersPackageVersion>
<MicrosoftCodeAnalysisBuildTasksPackageVersion>$(MicrosoftCodeAnalysisCSharpPackageVersion)</MicrosoftCodeAnalysisBuildTasksPackageVersion>
<MicrosoftNetCompilersNetcorePackageVersion>$(MicrosoftCodeAnalysisCSharpPackageVersion)</MicrosoftNetCompilersNetcorePackageVersion>
<MicrosoftNETSdkPackageVersion>1.0.0-preview-62924-09</MicrosoftNETSdkPackageVersion>
<MicrosoftNETSdkPackageVersion>2.1.400-preview-63010-01</MicrosoftNETSdkPackageVersion>
<MicrosoftNETBuildExtensionsPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETBuildExtensionsPackageVersion>
<MicrosoftNETSdkRazorPackageVersion>$(MicrosoftAspNetCoreAppPackageVersion)</MicrosoftNETSdkRazorPackageVersion>
<MicrosoftNETSdkWebPackageVersion>2.1.300</MicrosoftNETSdkWebPackageVersion>
Expand Down
1 change: 1 addition & 0 deletions src/dotnet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[assembly: InternalsVisibleTo("dotnet-add-package.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("dotnet-add-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("dotnet-help.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("dotnet-publish.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("dotnet-list-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("dotnet-remove-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("dotnet-remove-package.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
Expand Down
23 changes: 18 additions & 5 deletions src/dotnet/commands/dotnet-publish/LocalizableStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,16 @@
<data name="ManifestOptionDescription" xml:space="preserve">
<value>The path to a target manifest file that contains the list of packages to be excluded from the publish step.</value>
</data>
<data name="SelfContainedOptionDescription" xml:space="preserve">
<value>Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine.
The default is 'true' if a runtime identifier is specified.</value>
<data name="ModeOptionDescription" xml:space="preserve">
<value>The mode to use when publishing the application.
The 'self-contained' mode publishes the application with the .NET Core runtime.
The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable.
The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable.
The default is 'fx-dependent-no-exe' when a target runtime is not specified.
The default is 'self-contained' when a target runtime is specified.</value>
</data>
<data name="ModeOptionName" xml:space="preserve">
<value>MODE</value>
</data>
<data name="NoBuildOptionDescription" xml:space="preserve">
<value>Do not build the project before publishing. Implies --no-restore.</value>
Expand All @@ -146,10 +153,16 @@ The default is 'true' if a runtime identifier is specified.</value>
<value>The target framework to publish for. The target framework has to be specified in the project file.</value>
</data>
<data name="RuntimeOptionDescription" xml:space="preserve">
<value>The target runtime to publish for. This is used when creating self-contained deployment.
The default is to publish a framework-dependent application.</value>
<value>The target runtime to publish the application for.
The default is to publish a framework-dependent application without an executable.</value>
</data>
<data name="ConfigurationOptionDescription" xml:space="preserve">
<value>The configuration to publish for. The default for most projects is 'Debug'.</value>
</data>
<data name="PublishModeAndSelfContainedOptionsConflict" xml:space="preserve">
<value>The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options.</value>
</data>
<data name="UnsupportedPublishMode" xml:space="preserve">
<value>The specified publish mode '{0}' is not supported.</value>
</data>
</root>
31 changes: 31 additions & 0 deletions src/dotnet/commands/dotnet-publish/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,37 @@ public static PublishCommand FromArgs(string[] args, string msbuildPath = null)

var appliedPublishOption = result["dotnet"]["publish"];

if (appliedPublishOption.HasOption("mode") && appliedPublishOption.HasOption("self-contained"))
{
throw new GracefulException(LocalizableStrings.PublishModeAndSelfContainedOptionsConflict);
}

var mode = appliedPublishOption.ValueOrDefault<string>("mode");
switch (mode)
{
case null:
break;

case PublishCommandParser.SelfContainedMode:
msbuildArgs.Add("-p:SelfContained=true");
break;

case PublishCommandParser.FxDependentMode:
msbuildArgs.Add("-p:SelfContained=false");
break;

case PublishCommandParser.FxDependentNoExeMode:
msbuildArgs.Add("-p:SelfContained=false");
msbuildArgs.Add("-p:UseAppHost=false");
break;

default:
throw new GracefulException(
string.Format(
LocalizableStrings.UnsupportedPublishMode,
mode));
}

msbuildArgs.AddRange(appliedPublishOption.OptionValuesToBeForwarded());

msbuildArgs.AddRange(appliedPublishOption.Arguments);
Expand Down
14 changes: 13 additions & 1 deletion src/dotnet/commands/dotnet-publish/PublishCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ namespace Microsoft.DotNet.Cli
{
internal static class PublishCommandParser
{
public const string SelfContainedMode = "self-contained";
public const string FxDependentMode = "fx-dependent";
public const string FxDependentNoExeMode = "fx-dependent-no-exe";

public static Command Publish() =>
CreateWithRestoreOptions.Command(
"publish",
Expand Down Expand Up @@ -40,14 +44,22 @@ public static Command Publish() =>
Accept.NoArguments().ForwardAs("-property:NoBuild=true")),
Create.Option(
"--self-contained",
LocalizableStrings.SelfContainedOptionDescription,
"", // Hidden option for backwards-compatibility (now '--mode self-contained').
Accept.ZeroOrOneArgument()
.WithSuggestionsFrom("true", "false")
.ForwardAsSingle(o =>
{
string value = o.Arguments.Any() ? o.Arguments.Single() : "true";
return $"-property:SelfContained={value}";
})),
Create.Option(
"--mode",
LocalizableStrings.ModeOptionDescription,
Accept.AnyOneOf(
SelfContainedMode,
FxDependentMode,
FxDependentNoExeMode)
.With(name: LocalizableStrings.ModeOptionName)),
CommonOptions.NoRestoreOption(),
CommonOptions.VerbosityOption());
}
Expand Down
44 changes: 34 additions & 10 deletions src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,53 @@
<target state="translated">Cesta k cílovému souboru manifestu obsahujícímu seznam balíčků, které se mají vyloučit z kroku publikování</target>
<note />
</trans-unit>
<trans-unit id="SelfContainedOptionDescription">
<source>Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine.
The default is 'true' if a runtime identifier is specified.</source>
<target state="needs-review-translation">Publikuje spolu s aplikací modul runtime .NET Core, aby se tento modul nemusel instalovat na cílový počítač. Standardně se nastaví na True, pokud je zadaný identifikátor modulu runtime.</target>
<note />
</trans-unit>
<trans-unit id="NoBuildOptionDescription">
<source>Do not build the project before publishing. Implies --no-restore.</source>
<target state="translated">Nesestavujte projekt, dokud ho nepublikujete. Implikuje možnost --no-restore.</target>
<note />
</trans-unit>
<trans-unit id="RuntimeOptionDescription">
<source>The target runtime to publish for. This is used when creating self-contained deployment.
The default is to publish a framework-dependent application.</source>
<target state="new">The target runtime to publish for. This is used when creating self-contained deployment.
The default is to publish a framework-dependent application.</target>
<source>The target runtime to publish the application for.
The default is to publish a framework-dependent application without an executable.</source>
<target state="new">The target runtime to publish the application for.
The default is to publish a framework-dependent application without an executable.</target>
<note />
</trans-unit>
<trans-unit id="ConfigurationOptionDescription">
<source>The configuration to publish for. The default for most projects is 'Debug'.</source>
<target state="new">The configuration to publish for. The default for most projects is 'Debug'.</target>
<note />
</trans-unit>
<trans-unit id="ModeOptionDescription">
<source>The mode to use when publishing the application.
The 'self-contained' mode publishes the application with the .NET Core runtime.
The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable.
The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable.
The default is 'fx-dependent-no-exe' when a target runtime is not specified.
The default is 'self-contained' when a target runtime is specified.</source>
<target state="new">The mode to use when publishing the application.
The 'self-contained' mode publishes the application with the .NET Core runtime.
The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable.
The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable.
The default is 'fx-dependent-no-exe' when a target runtime is not specified.
The default is 'self-contained' when a target runtime is specified.</target>
<note />
</trans-unit>
<trans-unit id="ModeOptionName">
<source>MODE</source>
<target state="new">MODE</target>
<note />
</trans-unit>
<trans-unit id="PublishModeAndSelfContainedOptionsConflict">
<source>The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options.</source>
<target state="new">The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options.</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedPublishMode">
<source>The specified publish mode '{0}' is not supported.</source>
<target state="new">The specified publish mode '{0}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
44 changes: 34 additions & 10 deletions src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,53 @@
<target state="translated">Der Pfad zu einer Zielmanifestdatei, die die Liste der von der Veröffentlichung auszuschließenden Pakete enthält.</target>
<note />
</trans-unit>
<trans-unit id="SelfContainedOptionDescription">
<source>Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine.
The default is 'true' if a runtime identifier is specified.</source>
<target state="needs-review-translation">Veröffentlichen Sie die .NET Core-Runtime mit Ihrer Anwendung, damit die Runtime auf dem Zielcomputer nicht installiert werden muss. Der Standardwert ist "true", wenn ein Runtimebezeichner angegeben ist.</target>
<note />
</trans-unit>
<trans-unit id="NoBuildOptionDescription">
<source>Do not build the project before publishing. Implies --no-restore.</source>
<target state="translated">Erstellt das Projekt nicht vor dem Veröffentlichen. Impliziert "--no-restore".</target>
<note />
</trans-unit>
<trans-unit id="RuntimeOptionDescription">
<source>The target runtime to publish for. This is used when creating self-contained deployment.
The default is to publish a framework-dependent application.</source>
<target state="new">The target runtime to publish for. This is used when creating self-contained deployment.
The default is to publish a framework-dependent application.</target>
<source>The target runtime to publish the application for.
The default is to publish a framework-dependent application without an executable.</source>
<target state="new">The target runtime to publish the application for.
The default is to publish a framework-dependent application without an executable.</target>
<note />
</trans-unit>
<trans-unit id="ConfigurationOptionDescription">
<source>The configuration to publish for. The default for most projects is 'Debug'.</source>
<target state="new">The configuration to publish for. The default for most projects is 'Debug'.</target>
<note />
</trans-unit>
<trans-unit id="ModeOptionDescription">
<source>The mode to use when publishing the application.
The 'self-contained' mode publishes the application with the .NET Core runtime.
The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable.
The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable.
The default is 'fx-dependent-no-exe' when a target runtime is not specified.
The default is 'self-contained' when a target runtime is specified.</source>
<target state="new">The mode to use when publishing the application.
The 'self-contained' mode publishes the application with the .NET Core runtime.
The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable.
The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable.
The default is 'fx-dependent-no-exe' when a target runtime is not specified.
The default is 'self-contained' when a target runtime is specified.</target>
<note />
</trans-unit>
<trans-unit id="ModeOptionName">
<source>MODE</source>
<target state="new">MODE</target>
<note />
</trans-unit>
<trans-unit id="PublishModeAndSelfContainedOptionsConflict">
<source>The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options.</source>
<target state="new">The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options.</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedPublishMode">
<source>The specified publish mode '{0}' is not supported.</source>
<target state="new">The specified publish mode '{0}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Loading