Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit b6174af

Browse files
committed
Implement dotnet publish --no-build
1 parent 1e2e813 commit b6174af

19 files changed

+152
-6
lines changed

build/DependencyVersions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<MicrosoftNETCoreCompilersPackageVersion>$(MicrosoftCodeAnalysisCSharpPackageVersion)</MicrosoftNETCoreCompilersPackageVersion>
1515
<MicrosoftCodeAnalysisBuildTasksPackageVersion>$(MicrosoftCodeAnalysisCSharpPackageVersion)</MicrosoftCodeAnalysisBuildTasksPackageVersion>
1616
<MicrosoftNetCompilersNetcorePackageVersion>$(MicrosoftCodeAnalysisCSharpPackageVersion)</MicrosoftNetCompilersNetcorePackageVersion>
17-
<MicrosoftNETSdkPackageVersion>2.1.300-preview2-62716-01</MicrosoftNETSdkPackageVersion>
17+
<MicrosoftNETSdkPackageVersion>2.1.300-preview3-62804-06</MicrosoftNETSdkPackageVersion>
1818
<MicrosoftNETBuildExtensionsPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETBuildExtensionsPackageVersion>
1919
<MicrosoftNETSdkRazorPackageVersion>$(MicrosoftAspNetCoreAppPackageVersion)</MicrosoftNETSdkRazorPackageVersion>
2020
<MicrosoftNETSdkWebPackageVersion>2.1.300-preview2-20180306-1448279</MicrosoftNETSdkWebPackageVersion>

src/dotnet/commands/dotnet-publish/LocalizableStrings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,7 @@
141141
<data name="SelfContainedOptionDescription" xml:space="preserve">
142142
<value>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.</value>
143143
</data>
144+
<data name="NoBuildOptionDescription" xml:space="preserve">
145+
<value>Do not build project before publishing. Implies --no-restore.</value>
146+
</data>
144147
</root>

src/dotnet/commands/dotnet-publish/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public static PublishCommand FromArgs(string[] args, string msbuildPath = null)
4343

4444
msbuildArgs.AddRange(appliedPublishOption.Arguments);
4545

46-
bool noRestore = appliedPublishOption.HasOption("--no-restore");
46+
bool noRestore = appliedPublishOption.HasOption("--no-restore")
47+
|| appliedPublishOption.HasOption("--no-build");
4748

4849
return new PublishCommand(
4950
msbuildArgs,
@@ -70,4 +71,4 @@ public static int Run(string[] args)
7071
return cmd.Execute();
7172
}
7273
}
73-
}
74+
}

src/dotnet/commands/dotnet-publish/PublishCommandParser.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) .NET Foundation and contributors. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
using System.Collections.Generic;
54
using System.Linq;
65
using Microsoft.DotNet.Cli.CommandLine;
76
using Microsoft.DotNet.Tools;
@@ -33,6 +32,10 @@ public static Command Publish() =>
3332
Accept.OneOrMoreArguments()
3433
.With(name: LocalizableStrings.ManifestOption)
3534
.ForwardAsSingle(o => $"-property:TargetManifestFiles={string.Join("%3B", o.Arguments)}")),
35+
Create.Option(
36+
"--no-build",
37+
LocalizableStrings.NoBuildOptionDescription,
38+
Accept.NoArguments().ForwardAs("-property:NoBuild=true")),
3639
Create.Option(
3740
"--self-contained",
3841
LocalizableStrings.SelfContainedOptionDescription,
@@ -46,4 +49,4 @@ public static Command Publish() =>
4649
CommonOptions.NoRestoreOption(),
4750
CommonOptions.VerbosityOption());
4851
}
49-
}
52+
}

src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
<target state="translated">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>
4343
<note />
4444
</trans-unit>
45+
<trans-unit id="NoBuildOptionDescription">
46+
<source>Do not build project before publishing. Implies --no-restore.</source>
47+
<target state="new">Do not build project before publishing. Implies --no-restore.</target>
48+
<note />
49+
</trans-unit>
4550
</body>
4651
</file>
4752
</xliff>

src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
<target state="translated">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>
4343
<note />
4444
</trans-unit>
45+
<trans-unit id="NoBuildOptionDescription">
46+
<source>Do not build project before publishing. Implies --no-restore.</source>
47+
<target state="new">Do not build project before publishing. Implies --no-restore.</target>
48+
<note />
49+
</trans-unit>
4550
</body>
4651
</file>
4752
</xliff>

src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
<target state="translated">Publica el tiempo de ejecución de .NET Core con su aplicación para que no sea necesario instalarlo en la máquina de destino. Si se especifica un identificador de tiempo de ejecución, se toma como predeterminado el valor "true".</target>
4343
<note />
4444
</trans-unit>
45+
<trans-unit id="NoBuildOptionDescription">
46+
<source>Do not build project before publishing. Implies --no-restore.</source>
47+
<target state="new">Do not build project before publishing. Implies --no-restore.</target>
48+
<note />
49+
</trans-unit>
4550
</body>
4651
</file>
4752
</xliff>

src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
<target state="translated">Publiez le runtime .NET Core avec votre application pour éviter à l'utilisateur de l'installer sur la machine cible. La valeur par défaut est 'true' si un identificateur de runtime est spécifié.</target>
4343
<note />
4444
</trans-unit>
45+
<trans-unit id="NoBuildOptionDescription">
46+
<source>Do not build project before publishing. Implies --no-restore.</source>
47+
<target state="new">Do not build project before publishing. Implies --no-restore.</target>
48+
<note />
49+
</trans-unit>
4550
</body>
4651
</file>
4752
</xliff>

src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
<target state="translated">Pubblica il runtime di .NET Core con l'applicazione in modo che non sia necessario installarlo nel computer di destinazione. Se si specifica un identificatore di runtime, l'impostazione predefinita è 'true'.</target>
4343
<note />
4444
</trans-unit>
45+
<trans-unit id="NoBuildOptionDescription">
46+
<source>Do not build project before publishing. Implies --no-restore.</source>
47+
<target state="new">Do not build project before publishing. Implies --no-restore.</target>
48+
<note />
49+
</trans-unit>
4550
</body>
4651
</file>
4752
</xliff>

src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
<target state="translated">ランタイムをターゲット マシンにインストールしなくてもよいよう、.NET Core ランタイムをアプリケーションと一緒に発行します。ランタイム ID が指定される場合、既定の 'true' になります。</target>
4343
<note />
4444
</trans-unit>
45+
<trans-unit id="NoBuildOptionDescription">
46+
<source>Do not build project before publishing. Implies --no-restore.</source>
47+
<target state="new">Do not build project before publishing. Implies --no-restore.</target>
48+
<note />
49+
</trans-unit>
4550
</body>
4651
</file>
4752
</xliff>

0 commit comments

Comments
 (0)