diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index db2ce09ba..ea2d66737 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -95,14 +95,14 @@ project { allowEmpty = true, display = ParameterDisplay.NORMAL) text ( - "env.SignPathProjectKey", - label = "SignPathProjectKey", + "env.SignPathProjectSlug", + label = "SignPathProjectSlug", value = "", allowEmpty = true, display = ParameterDisplay.NORMAL) text ( - "env.SignPathPolicyKey", - label = "SignPathPolicyKey", + "env.SignPathPolicySlug", + label = "SignPathPolicySlug", value = "", allowEmpty = true, display = ParameterDisplay.NORMAL) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ebcddad9..c9b245ad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,27 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [vNext] +## [5.0.1] / 2020-12-06 +- Fixed configuration generation to wait for user input after file changes +- Fixed build summary for durations smaller than 1 second +- Fixed build summary and `IBuildExtension` instances to be skipped if no targets were started +- Fixed build summary to hide irrelevant durations +- Fixed setting of `EmbeddedPackagesDirectory` for global tools +- Fixed `PackPackageToolsTask` to use lower-case package ids +- Fixed `ParameterAttribute.ValueProvider` to allow members of type `IEnumerable` +- Fixed `Logger` to remove `ControlFlow` from stacktrace +- Fixed assertion messages for warnings +- Fixed path and quoting in `build.cmd` +- Fixed `GitVersion.Tool` version in project templates +- Fixed `LatestMyGetVersionAttribute` to handle new RSS feed format +- Fixed missing arguments `PublishReadyToRun`, `PublishSingleFile`, `PublishTrimmed`, `PublishProfile`, `NoLogo` for `DotNetPublish` +- Fixed parameter name `Verbosity` in `DotNetPack` +- Fixed enumeration value `lcov` in `CoverletTasks` +- Fixed `ReSharperTasks` to use correct tool path +- Fixed `ChangelogTasks` to respect additional markdown-linting rules +- Fixed TeamCity generator to consider artifact products from all relevant targets +- Fixed condition for skipping lines in TeamCity parameter files + ## [5.0.0] / 2020-11-12 - Fixed version number @@ -639,7 +660,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added CLT tasks for Git - Fixed background color in console output -[vNext]: git@github.com:nuke-build/nuke/compare/5.0.0...HEAD +[vNext]: git@github.com:nuke-build/nuke/compare/5.0.1...HEAD +[5.0.1]: git@github.com:nuke-build/nuke/compare/5.0.0...5.0.1 [5.0.0]: git@github.com:nuke-build/nuke/compare/0.25.0...5.0.0 [0.25.0]: git@github.com:nuke-build/nuke/compare/0.24.11...0.25.0 [0.24.11]: git@github.com:nuke-build/nuke/compare/0.24.10...0.24.11 diff --git a/appveyor.yml b/appveyor.yml index 453481451..31cf211a7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,7 +32,7 @@ artifacts: environment: SignPathApiToken: - secure: 8qQa3PGEnzXnm1sqqcHZyonFZ/ONlg6nsnFjbkhADU9fJyhSV+0daA/mqWhO9yAb + secure: zYFzA/7H1MDXDlpX6SAyv41kiBmu8Vh3kvWC7tPfk7eVdhh9mGQgXC7AzgcGnpsg SignPathOrganizationId: 0fdaf334-6910-41f4-83d2-e58e4cccb087 - SignPathProjectKey: nuke - SignPathPolicyKey: test-signing + SignPathProjectSlug: nuke + SignPathPolicySlug: release-signing diff --git a/build.cmd b/build.cmd index 4a72f9bcf..8b8b89dc9 100755 --- a/build.cmd +++ b/build.cmd @@ -4,4 +4,4 @@ :; exit $? @ECHO OFF -powershell -ExecutionPolicy ByPass -NoProfile %0\..\build.ps1 %* +powershell -ExecutionPolicy ByPass -NoProfile "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 index a83bff234..433ad6a0b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -37,6 +37,11 @@ function ExecSafe([scriptblock] $cmd) { # Print environment variables Get-Item -Path Env:* | Sort-Object -Property Name | ForEach-Object {"{0}={1}" -f $_.Name,$_.Value} +# Check if any dotnet is installed +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue)) { + ExecSafe { & dotnet --info } +} + # If dotnet CLI is installed globally and it matches requested version, use for execution if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` $(dotnet --version) -and $LASTEXITCODE -eq 0) { diff --git a/build.sh b/build.sh index cb3ec1f53..bd1e6a861 100755 --- a/build.sh +++ b/build.sh @@ -32,6 +32,11 @@ function FirstJsonValue { # Print environment variables env | sort +# Check if any dotnet is installed +if [[ -x "$(command -v dotnet)" ]]; then + dotnet --info +fi + # If dotnet CLI is installed globally and it matches requested version, use for execution if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then export DOTNET_EXE="$(command -v dotnet)" diff --git a/build/Build.GitFlow.cs b/build/Build.GitFlow.cs index 331f25a8f..d4c4a9ba4 100644 --- a/build/Build.GitFlow.cs +++ b/build/Build.GitFlow.cs @@ -19,13 +19,14 @@ partial class Build { [Parameter] readonly bool AutoStash = true; + string MajorMinorPatchVersion => GitVersion.MajorMinorPatch; Target Milestone => _ => _ .Unlisted() .OnlyWhenStatic(() => GitRepository.IsOnReleaseBranch() || GitRepository.IsOnHotfixBranch()) .Executes(async () => { - var milestoneTitle = $"v{GitVersion.MajorMinorPatch}"; + var milestoneTitle = $"v{MajorMinorPatchVersion}"; var milestone = (await GitRepository.GetGitHubMilestone(milestoneTitle)).NotNull("milestone != null"); Assert(milestone.OpenIssues == 0, "milestone.OpenIssues == 0"); Assert(milestone.ClosedIssues != 0, "milestone.ClosedIssues != 0"); @@ -38,12 +39,12 @@ partial class Build .OnlyWhenStatic(() => GitRepository.IsOnReleaseBranch() || GitRepository.IsOnHotfixBranch()) .Executes(() => { - FinalizeChangelog(ChangelogFile, GitVersion.MajorMinorPatch, GitRepository); + FinalizeChangelog(ChangelogFile, MajorMinorPatchVersion, GitRepository); Logger.Info("Please review CHANGELOG.md and press any key to continue..."); System.Console.ReadKey(); Git($"add {ChangelogFile}"); - Git($"commit -m \"Finalize {Path.GetFileName(ChangelogFile)} for {GitVersion.MajorMinorPatch}\""); + Git($"commit -m \"Finalize {Path.GetFileName(ChangelogFile)} for {MajorMinorPatchVersion}\""); }); [UsedImplicitly] @@ -53,7 +54,7 @@ partial class Build .Executes(() => { if (!GitRepository.IsOnReleaseBranch()) - Checkout($"{ReleaseBranchPrefix}/{GitVersion.MajorMinorPatch}", start: DevelopBranch); + Checkout($"{ReleaseBranchPrefix}/{MajorMinorPatchVersion}", start: DevelopBranch); else FinishReleaseOrHotfix(); }); @@ -65,7 +66,7 @@ partial class Build .Executes(() => { var masterVersion = GitVersion(s => s - .SetFramework("netcoreapp3.0") + .SetFramework("netcoreapp3.1") .SetUrl(RootDirectory) .SetBranch(MasterBranch) .EnableNoFetch() @@ -81,14 +82,14 @@ void FinishReleaseOrHotfix() { Git($"checkout {MasterBranch}"); Git($"merge --no-ff --no-edit {GitRepository.Branch}"); - Git($"tag {GitVersion.MajorMinorPatch}"); + Git($"tag {MajorMinorPatchVersion}"); Git($"checkout {DevelopBranch}"); Git($"merge --no-ff --no-edit {GitRepository.Branch}"); Git($"branch -D {GitRepository.Branch}"); - Git($"push origin {MasterBranch} {DevelopBranch} {GitVersion.MajorMinorPatch}"); + Git($"push origin {MasterBranch} {DevelopBranch} {MajorMinorPatchVersion}"); } void Checkout(string branch, string start) diff --git a/build/Build.ReleaseImage.cs b/build/Build.ReleaseImage.cs index 7c1ba1289..e09f29ad2 100644 --- a/build/Build.ReleaseImage.cs +++ b/build/Build.ReleaseImage.cs @@ -88,7 +88,7 @@ partial class Build location: new PointF(image.Width / 2f, image.Height / 2f - 100), options: graphicsOptions) .DrawText( - text: "0.24.0", + text: MajorMinorPatchVersion, font: robotoFont.CreateFont(150), color: Color.WhiteSmoke, location: new PointF(image.Width / 2f, image.Height / 2f), diff --git a/build/Build.SignPackages.cs b/build/Build.SignPackages.cs index c72689ecf..09c306c06 100644 --- a/build/Build.SignPackages.cs +++ b/build/Build.SignPackages.cs @@ -7,14 +7,13 @@ using System.IO; using System.Linq; using Nuke.Common; +using Nuke.Common.Git; using Nuke.Common.IO; using Nuke.Common.Utilities; using Nuke.Components; partial class Build : ISignPackages { - // https://ci.appveyor.com/tools/encrypt - public IEnumerable SignPathPackages => PackageFiles .Where(x => Path.GetFileName(x).StartsWithAny( "Nuke.Common", @@ -24,5 +23,7 @@ partial class Build : ISignPackages public Target SignPackages => _ => _ .Inherit(x => x.SignPackages) + .OnlyWhenStatic(() => GitRepository.IsOnMasterBranch()) + .OnlyWhenStatic(() => EnvironmentInfo.IsWin) .TriggeredBy(Pack); } diff --git a/build/_build.csproj b/build/_build.csproj index 1ba0ac5bd..54e478c44 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -36,7 +36,7 @@ - + diff --git a/build/specifications/Coverlet.json b/build/specifications/Coverlet.json index e0aa6d1f4..95fb0ebb8 100644 --- a/build/specifications/Coverlet.json +++ b/build/specifications/Coverlet.json @@ -135,7 +135,7 @@ "name": "CoverletOutputFormat", "values": [ "json", - "Icov", + "lcov", "opencover", "cobertura", "teamcity" diff --git a/build/specifications/DotNet.json b/build/specifications/DotNet.json index ffc9b30d5..4a921966a 100644 --- a/build/specifications/DotNet.json +++ b/build/specifications/DotNet.json @@ -289,7 +289,7 @@ "help": "Sets the serviceable flag in the package. For more information, see .NET Blog: .NET 4.5.1 Supports Microsoft Security Updates for .NET NuGet Libraries." }, { - "name": "Verbostiy", + "name": "Verbosity", "type": "DotNetVerbosity", "format": "--verbosity {value}", "help": "Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]." @@ -520,6 +520,12 @@ "type": "string", "format": "--version-suffix {value}", "help": "Defines the version suffix for an asterisk (*) in the version field of the project file. The format follows NuGet's version guidelines." + }, + { + "name": "NoLogo", + "type": "bool", + "format": "--nologo", + "help": "Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK." } ] } @@ -910,6 +916,25 @@ "name": "SymbolPackageFormat", "type": "DotNetSymbolPackageFormat", "help": "Format for packaging symbols." + }, + { + "name": "PublishReadyToRun", + "type": "bool", + "help": "Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild." + }, + { + "name": "PublishSingleFile", + "type": "bool", + "help": "Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild." + }, + { + "name": "PublishTrimmed", + "type": "bool", + "help": "Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild." + }, + { + "name": "PublishProfile", + "type": "string" } ] } diff --git a/build/specifications/ReSharper.json b/build/specifications/ReSharper.json index 557b5fe11..9ec3ecc23 100644 --- a/build/specifications/ReSharper.json +++ b/build/specifications/ReSharper.json @@ -6,7 +6,7 @@ "name": "ReSharper", "officialUrl": "https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html", "packageId": "JetBrains.ReSharper.GlobalTools", - "packageExecutable": "JetBrains.CommandLine.Products.exe", + "packageExecutable": "JetBrains.CommandLine.Products.dll", "tasks": [ { "help": "One of ReSharper's most notable features, code inspection, is available even without opening Visual Studio. InspectCode, a free command line tool requires a minimum of one parameter- your solution file- to apply all of ReSharper's inspections.", diff --git a/shell-completion.yml b/shell-completion.yml index 399bebc26..fbcd452ab 100644 --- a/shell-completion.yml +++ b/shell-completion.yml @@ -24,8 +24,8 @@ Plan: Root: SignPathApiToken: SignPathOrganizationId: -SignPathPolicyKey: -SignPathProjectKey: +SignPathPolicySlug: +SignPathProjectSlug: Skip: - Analysis - Announce diff --git a/source/Directory.Build.props b/source/Directory.Build.props index 95b6da439..3c7332455 100644 --- a/source/Directory.Build.props +++ b/source/Directory.Build.props @@ -46,11 +46,11 @@ - + diff --git a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.GitHubActionsAttribute.detailed-triggers.approved.txt b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=detailed-triggers_attribute=GitHubActionsAttribute.verified.txt similarity index 88% rename from source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.GitHubActionsAttribute.detailed-triggers.approved.txt rename to source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=detailed-triggers_attribute=GitHubActionsAttribute.verified.txt index a208abeb4..a67df06eb 100644 --- a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.GitHubActionsAttribute.detailed-triggers.approved.txt +++ b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=detailed-triggers_attribute=GitHubActionsAttribute.verified.txt @@ -44,6 +44,10 @@ jobs: - uses: actions/checkout@v1 - name: Run './build.cmd Test' run: ./build.cmd Test + - uses: actions/upload-artifact@v1 + with: + name: src + path: src - uses: actions/upload-artifact@v1 with: name: test-results @@ -59,6 +63,10 @@ jobs: - uses: actions/checkout@v1 - name: Run './build.cmd Test' run: ./build.cmd Test + - uses: actions/upload-artifact@v1 + with: + name: src + path: src - uses: actions/upload-artifact@v1 with: name: test-results @@ -74,6 +82,10 @@ jobs: - uses: actions/checkout@v1 - name: Run './build.cmd Test' run: ./build.cmd Test + - uses: actions/upload-artifact@v1 + with: + name: src + path: src - uses: actions/upload-artifact@v1 with: name: test-results diff --git a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.AppVeyorAttribute.approved.txt b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=AppVeyorAttribute.verified.txt similarity index 88% rename from source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.AppVeyorAttribute.approved.txt rename to source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=AppVeyorAttribute.verified.txt index 7b26a8453..27f944c36 100644 --- a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.AppVeyorAttribute.approved.txt +++ b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=AppVeyorAttribute.verified.txt @@ -28,9 +28,12 @@ skip_tags: true skip_branch_with_pr: true build_script: - - ps: .\build.ps1 Test + - cmd: .\build.cmd Test + - sh: ./build.cmd Test artifacts: + - path: src/*/obj/** + - path: src/*/bin/** - path: output/test-results/*.trx - path: output/test-results/*.xml - path: output/coverage-report.zip diff --git a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.AzurePipelinesAttribute.approved.txt b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=AzurePipelinesAttribute.verified.txt similarity index 89% rename from source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.AzurePipelinesAttribute.approved.txt rename to source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=AzurePipelinesAttribute.verified.txt index 9e9b21e68..192820cc1 100644 --- a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.AzurePipelinesAttribute.approved.txt +++ b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=AzurePipelinesAttribute.verified.txt @@ -36,7 +36,7 @@ trigger: - excluded_path stages: - - stage: ubuntu_18.04 + - stage: ubuntu_18_04 displayName: 'ubuntu-18.04' dependsOn: [ ] pool: @@ -52,6 +52,10 @@ stages: env: AzurePipelinesSystemAccessToken: $(System.AccessToken) GitHubToken: $(GitHubToken) + - task: PublishBuildArtifacts@1 + inputs: + artifactName: src + pathtoPublish: 'src' - job: Compile displayName: 'Compile' dependsOn: [ Restore ] @@ -62,6 +66,10 @@ stages: env: AzurePipelinesSystemAccessToken: $(System.AccessToken) GitHubToken: $(GitHubToken) + - task: PublishBuildArtifacts@1 + inputs: + artifactName: src + pathtoPublish: 'src' - job: Test displayName: 'Test' dependsOn: [ Compile ] @@ -108,6 +116,10 @@ stages: env: AzurePipelinesSystemAccessToken: $(System.AccessToken) GitHubToken: $(GitHubToken) + - task: PublishBuildArtifacts@1 + inputs: + artifactName: src + pathtoPublish: 'src' - job: Compile displayName: 'Compile' dependsOn: [ Restore ] @@ -118,6 +130,10 @@ stages: env: AzurePipelinesSystemAccessToken: $(System.AccessToken) GitHubToken: $(GitHubToken) + - task: PublishBuildArtifacts@1 + inputs: + artifactName: src + pathtoPublish: 'src' - job: Test displayName: 'Test' dependsOn: [ Compile ] diff --git a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.TeamCityAttribute.approved.txt b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=TeamCityAttribute.verified.txt similarity index 96% rename from source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.TeamCityAttribute.approved.txt rename to source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=TeamCityAttribute.verified.txt index 63f851033..8c036c94f 100644 --- a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.TeamCityAttribute.approved.txt +++ b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=null_attribute=TeamCityAttribute.verified.txt @@ -53,7 +53,7 @@ project { select ( "env.Configuration", label = "Configuration", - description = "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + description = "Configuration for compilation", value = "Debug", options = listOf("Debug" to "Debug", "Release" to "Release"), display = ParameterDisplay.NORMAL) @@ -86,6 +86,7 @@ object Restore : BuildType({ root(DslContext.settingsRoot) cleanCheckout = true } + artifactRules = "src/*/obj/** => src" steps { exec { path = "build.sh" @@ -99,6 +100,7 @@ object Compile : BuildType({ root(DslContext.settingsRoot) cleanCheckout = true } + artifactRules = "src/*/bin/** => src" steps { exec { path = "build.sh" @@ -245,6 +247,12 @@ object Pack : BuildType({ onDependencyFailure = FailureAction.FAIL_TO_START onDependencyCancel = FailureAction.CANCEL } + artifacts(Restore) { + artifactRules = "src/*/obj/** => src" + } + artifacts(Compile) { + artifactRules = "src/*/bin/** => src" + } } }) object Publish : BuildType({ diff --git a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.GitHubActionsAttribute.simple-triggers.approved.txt b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=simple-triggers_attribute=GitHubActionsAttribute.verified.txt similarity index 88% rename from source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.GitHubActionsAttribute.simple-triggers.approved.txt rename to source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=simple-triggers_attribute=GitHubActionsAttribute.verified.txt index 6fe330470..1b2f5f36e 100644 --- a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test.GitHubActionsAttribute.simple-triggers.approved.txt +++ b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.Test_testName=simple-triggers_attribute=GitHubActionsAttribute.verified.txt @@ -29,6 +29,10 @@ jobs: env: GitHubToken: ${{ secrets.GITHUB_TOKEN }} ApiKey: ${{ secrets.ApiKey }} + - uses: actions/upload-artifact@v1 + with: + name: src + path: src - uses: actions/upload-artifact@v1 with: name: test-results @@ -47,6 +51,10 @@ jobs: env: GitHubToken: ${{ secrets.GITHUB_TOKEN }} ApiKey: ${{ secrets.ApiKey }} + - uses: actions/upload-artifact@v1 + with: + name: src + path: src - uses: actions/upload-artifact@v1 with: name: test-results @@ -65,6 +73,10 @@ jobs: env: GitHubToken: ${{ secrets.GITHUB_TOKEN }} ApiKey: ${{ secrets.ApiKey }} + - uses: actions/upload-artifact@v1 + with: + name: src + path: src - uses: actions/upload-artifact@v1 with: name: test-results diff --git a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.cs b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.cs index 137b2fba0..9533d4eeb 100644 --- a/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.cs +++ b/source/Nuke.Common.Tests/CI/ConfigurationGenerationTest.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Maintainers of NUKE. +// Copyright 2020 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE @@ -7,9 +7,7 @@ using System.ComponentModel; using System.IO; using System.Linq; -using ApprovalTests; -using ApprovalTests.Namers; -using ApprovalTests.Reporters; +using System.Threading.Tasks; using Nuke.Common.CI; using Nuke.Common.CI.AppVeyor; using Nuke.Common.CI.AzurePipelines; @@ -18,17 +16,18 @@ using Nuke.Common.Execution; using Nuke.Common.IO; using Nuke.Common.Tooling; +using VerifyXunit; +using VerifyTests; using Xunit; namespace Nuke.Common.Tests.CI { - [UseReporter(typeof(DiffReporter))] + [UsesVerify] public class ConfigurationGenerationTest { - // TODO: https://github.com/approvals/ApprovalTests.Net/issues/134 - [Theory(Skip = "Line ending")] + [Theory] [MemberData(nameof(GetAttributes))] - public void Test(string testName, ITestConfigurationGenerator attribute) + public Task Test(string testName, ITestConfigurationGenerator attribute) { var build = new TestBuild(); var relevantTargets = ExecutableTargetFactory.CreateAll(build, x => x.Compile); @@ -41,10 +40,8 @@ public void Test(string testName, ITestConfigurationGenerator attribute) var reader = new StreamReader(stream); var str = reader.ReadToEnd(); - NamerFactory.AdditionalInformation = attribute.GetType().BaseType.NotNull().Name; - if (testName != null) - NamerFactory.AdditionalInformation += "." + testName; - Approvals.Verify(str); + return Verifier.Verify(str) + .UseParameters(testName, attribute.GetType().BaseType.NotNull().Name); } public static IEnumerable GetAttributes() @@ -147,25 +144,31 @@ public class TestBuild : NukeBuild ); } + public AbsolutePath SourceDirectory => RootDirectory / "src"; + public Target Clean => _ => _ .Before(Restore); [Parameter] public readonly bool IgnoreFailedSources; - public Target Restore => _ => _; + public Target Restore => _ => _ + .Produces(SourceDirectory / "*/obj/**"); - [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] - public readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; + [Parameter("Configuration for compilation")] + public readonly Configuration Configuration = Configuration.Debug; public AbsolutePath OutputDirectory => RootDirectory / "output"; public Target Compile => _ => _ - .DependsOn(Restore); + .DependsOn(Restore) + .Produces(SourceDirectory / "*/bin/**"); + public AbsolutePath PackageDirectory => OutputDirectory / "packages"; public Target Pack => _ => _ .DependsOn(Compile) + .Consumes(Restore, Compile) .Produces(PackageDirectory / "*.nupkg"); [Partition(2)] public readonly Partition TestPartition; diff --git a/source/Nuke.Common.Tests/Nuke.Common.Tests.csproj b/source/Nuke.Common.Tests/Nuke.Common.Tests.csproj index e7888c454..6a536442b 100644 --- a/source/Nuke.Common.Tests/Nuke.Common.Tests.csproj +++ b/source/Nuke.Common.Tests/Nuke.Common.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 diff --git a/source/Nuke.Common/CI/InvokeBuildServerConfigurationGenerationAttribute.cs b/source/Nuke.Common/CI/InvokeBuildServerConfigurationGenerationAttribute.cs index 039daa7f5..ad2d8a114 100644 --- a/source/Nuke.Common/CI/InvokeBuildServerConfigurationGenerationAttribute.cs +++ b/source/Nuke.Common/CI/InvokeBuildServerConfigurationGenerationAttribute.cs @@ -15,23 +15,25 @@ namespace Nuke.Common.CI { public class InvokeBuildServerConfigurationGenerationAttribute - : BuildServerConfigurationGenerationAttributeBase, IOnAfterLogo + : BuildServerConfigurationGenerationAttributeBase, IOnBeforeLogo { - public void OnAfterLogo( - NukeBuild build, - IReadOnlyCollection executableTargets, - IReadOnlyCollection executionPlan) + public void OnBeforeLogo(NukeBuild build, IReadOnlyCollection executableTargets) { if (NukeBuild.IsServerBuild) return; - GetGenerators(build) + var hasConfigurationChanged = GetGenerators(build) .Where(x => x.AutoGenerate) .AsParallel() - .ForAll(InvokeGeneration); + .Select(HasConfigurationChanged).ToList(); + if (hasConfigurationChanged.All(x => !x)) + return; + + Logger.Info("Press any key to continue..."); + Console.ReadKey(); } - private void InvokeGeneration(IConfigurationGenerator generator) + private bool HasConfigurationChanged(IConfigurationGenerator generator) { generator.GeneratedFiles.ForEach(FileSystemTasks.EnsureExistingParentDirectory); var previousHashes = generator.GeneratedFiles @@ -50,11 +52,12 @@ private void InvokeGeneration(IConfigurationGenerator generator) .Where(x => FileSystemTasks.GetFileHash(x) != previousHashes.GetValueOrDefault(x)) .Select(x => NukeBuild.RootDirectory.GetRelativePathTo(x)).ToList(); - if (changedFiles.Count > 0) - { - Logger.Warn($"{generator.Name} configuration files have changed."); - changedFiles.ForEach(x => Logger.Trace($"Updated {x}")); - } + if (changedFiles.Count == 0) + return false; + + Logger.Warn($"{generator.Name} configuration files have changed."); + changedFiles.ForEach(x => Logger.Trace($"Updated {x}")); + return true; } } } diff --git a/source/Nuke.Common/CI/TeamCity/TeamCity.cs b/source/Nuke.Common/CI/TeamCity/TeamCity.cs index 352ccc211..e87cc1529 100644 --- a/source/Nuke.Common/CI/TeamCity/TeamCity.cs +++ b/source/Nuke.Common/CI/TeamCity/TeamCity.cs @@ -63,7 +63,7 @@ private static IReadOnlyDictionary ParseDictionary([CanBeNull] s .Replace("\\:", ":") .Replace("\\=", "=") .Replace("\\\\", "\\"); - if (line[index: 0] == '#' || string.IsNullOrWhiteSpace(line)) + if (string.IsNullOrWhiteSpace(line) || line[index: 0] == '#') continue; var index = line.IndexOfRegex(@"[^\.]=") + 1; diff --git a/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs b/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs index cf187629a..f08e6519a 100644 --- a/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs +++ b/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs @@ -132,7 +132,7 @@ protected virtual IEnumerable GetBuildTypes( ArtifactExtensions.ArtifactProducts[x.Definition].Select(GetArtifactRule)).ToArray(); var artifactDependencies = chainLinkTargets.SelectMany(x => ( from artifactDependency in ArtifactExtensions.ArtifactDependencies[x.Definition] - let dependency = x.ExecutionDependencies.Single(y => y.Factory == artifactDependency.Item1) + let dependency = relevantTargets.Single(y => y.Factory == artifactDependency.Item1) let rules = (artifactDependency.Item2.Any() ? artifactDependency.Item2 : ArtifactExtensions.ArtifactProducts[dependency.Definition]) diff --git a/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs b/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs index 139cc8ce2..6b895c77c 100644 --- a/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs +++ b/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Maintainers of NUKE. +// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE @@ -22,7 +22,11 @@ public static class ChangelogTasks public static string GetNuGetReleaseNotes(string changelogFile, GitRepository repository = null) { var changelogSectionNotes = ExtractChangelogSectionNotes(changelogFile) - .Select(x => x.Replace("- ", "\u2022 ").Replace("`", string.Empty).Replace(",", "%2C")).ToList(); + .Select(x => x.Replace("- ", "\u2022 ") + .Replace("* ", "\u2022 ") + .Replace("+ ", "\u2022 ") + .Replace("`", string.Empty) + .Replace(",", "%2C")).ToList(); if (repository.IsGitHubRepository()) { @@ -160,7 +164,7 @@ public static void FinalizeChangelog(string changelogFile, string tag, [CanBeNul [Pure] public static IEnumerable ExtractChangelogSectionNotes(string changelogFile, string tag = null) { - var content = TextTasks.ReadAllLines(changelogFile).ToList(); + var content = TextTasks.ReadAllLines(changelogFile).Where(x => !string.IsNullOrWhiteSpace(x)).ToList(); var sections = GetReleaseSections(content); var section = tag == null ? sections.First(x => x.StartIndex < x.EndIndex) @@ -176,8 +180,10 @@ private static IEnumerable GetReleaseSections(List conte static bool IsReleaseHead(string str) => str.StartsWith("## "); - static bool IsReleaseContent(string str) - => str.StartsWith("###") || str.Trim().StartsWith("-"); + static bool IsReleaseContent(string str) => str.StartsWith("###") + || str.Trim().StartsWith("-") + || str.Trim().StartsWith("*") + || str.Trim().StartsWith("+"); static string GetCaption(string str) => str diff --git a/source/Nuke.Common/ControlFlow.cs b/source/Nuke.Common/ControlFlow.cs index f3cd55d12..614741c0b 100644 --- a/source/Nuke.Common/ControlFlow.cs +++ b/source/Nuke.Common/ControlFlow.cs @@ -55,7 +55,7 @@ public static void Fail(string text) public static void AssertWarn(bool condition, string text) { if (!condition) - Logger.Warn($"Assertion failed: {text}"); + Logger.Warn($"Check failed: {text}"); } /// @@ -108,7 +108,7 @@ public static T NotNullWarn([CanBeNull] this T obj, string text = null) public static IReadOnlyCollection NotEmpty([CanBeNull] this IEnumerable enumerable, string message = null) { var collection = enumerable.NotNull("enumerable != null").ToList().AsReadOnly(); - Assert(collection.Count > 0, message ?? $"IEnumerable{typeof(T).FullName}.Count > 0"); + Assert(collection.Count > 0, message ?? $"IEnumerable<{typeof(T).FullName}>.Count > 0"); return collection; } @@ -119,7 +119,7 @@ public static IReadOnlyCollection NotEmpty([CanBeNull] this IEnumerable public static IReadOnlyCollection NoNullItems([CanBeNull] this IEnumerable enumerable) { var collection = enumerable.NotNull("enumerable != null").ToList().AsReadOnly(); - Assert(collection.All(x => x != null), $"IEnumerable{typeof(T).FullName}.All(x => x != null)"); + Assert(collection.All(x => x != null), $"IEnumerable<{typeof(T).FullName}>.All(x => x != null)"); return collection; } diff --git a/source/Nuke.Common/Execution/BuildManager.cs b/source/Nuke.Common/Execution/BuildManager.cs index 173eeaed2..a4a26bd74 100644 --- a/source/Nuke.Common/Execution/BuildManager.cs +++ b/source/Nuke.Common/Execution/BuildManager.cs @@ -55,9 +55,9 @@ void ExecuteExtension(Expression> action) Logger.OutputSink = build.OutputSink; - if (NukeBuild.BuildProjectDirectory != null) - ToolPathResolver.ExecutingAssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - + ToolPathResolver.EmbeddedPackagesDirectory = NukeBuild.BuildProjectFile == null + ? Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + : null; ToolPathResolver.NuGetPackagesConfigFile = build.NuGetPackagesConfigFile; ToolPathResolver.NuGetAssetsConfigFile = build.NuGetAssetsConfigFile; @@ -94,7 +94,7 @@ void ExecuteExtension(Expression> action) } finally { - if (build.ExecutionPlan != null) + if (build.ExecutionPlan?.Any(x => x.Status != ExecutionStatus.NotRun) ?? false) Finish(); } diff --git a/source/Nuke.Common/Logger.cs b/source/Nuke.Common/Logger.cs index 12734a03b..0d3374508 100644 --- a/source/Nuke.Common/Logger.cs +++ b/source/Nuke.Common/Logger.cs @@ -8,6 +8,7 @@ using System.Reflection; using JetBrains.Annotations; using Nuke.Common.OutputSinks; +using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; namespace Nuke.Common @@ -299,6 +300,11 @@ public static void Error(Exception exception) private static void HandleException(Exception exception, Action exceptionOutput, string prefix = null) { + static string GetTrimmedStackTrace(Exception exception) + => exception.StackTrace.SplitLineBreaks() + .Where(x => !x.TrimStart().StartsWith($"at {typeof(ControlFlow).FullName}")) + .JoinNewLine(); + switch (exception) { case AggregateException ex: @@ -312,7 +318,9 @@ private static void HandleException(Exception exception, Action HandleException(ex.InnerException, exceptionOutput); break; default: - exceptionOutput($"{prefix}{exception.GetType().Name}: {exception.Message}", exception.StackTrace + EnvironmentInfo.NewLine); + exceptionOutput.Invoke( + $"{prefix}{exception.GetType().Name}: ".TrimStart("Exception: ") + exception.Message, + GetTrimmedStackTrace(exception) + EnvironmentInfo.NewLine); break; } } diff --git a/source/Nuke.Common/NukeBuild.cs b/source/Nuke.Common/NukeBuild.cs index e39c7eb9f..2f8fddd2a 100644 --- a/source/Nuke.Common/NukeBuild.cs +++ b/source/Nuke.Common/NukeBuild.cs @@ -53,12 +53,12 @@ namespace Nuke.Common // Before logo [InjectParameterValues(Priority = 100)] [GenerateBuildServerConfigurations(Priority = 50)] + [InvokeBuildServerConfigurationGeneration(Priority = 45)] [HandleShellCompletion(Priority = 40)] [UnsetVisualStudioEnvironmentVariables] // [SaveBuildProfile(Priority = 30)] // [LoadBuildProfiles(Priority = 25)] // After logo - [InvokeBuildServerConfigurationGeneration(Priority = 50)] [HandleHelpRequests(Priority = 5)] [HandleVisualStudioDebugging] [InjectNonParameterValues(Priority = -100)] diff --git a/source/Nuke.Common/OutputSinks/OutputSink.cs b/source/Nuke.Common/OutputSinks/OutputSink.cs index 0c98b6da3..8835a01d0 100644 --- a/source/Nuke.Common/OutputSinks/OutputSink.cs +++ b/source/Nuke.Common/OutputSinks/OutputSink.cs @@ -8,6 +8,8 @@ using System.Linq; using JetBrains.Annotations; using Nuke.Common.Execution; +using Nuke.Common.Git; +using Nuke.Common.Tools.GitHub; using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; @@ -68,9 +70,25 @@ internal virtual void WriteSummary(NukeBuild build) WriteNormal(); if (build.IsSuccessful) + { WriteSuccessfulBuild(); + + if (!GitRepository.FromLocalDirectory(NukeBuild.RootDirectory)?.IsGitHubRepository() ?? false) + { + WriteNormal(); + WriteInformation("If you like NUKE, you'll love what is coming! 🤓"); + WriteInformation("We're currently waiting for more sponsors to release a new version."); + WriteInformation("Please check out our tiers: https://github.com/sponsors/matkoch"); + WriteInformation("As a sponsor you'll also gain access to numerous perks. 🚀"); + WriteNormal(); + WriteInformation("Happy building! 🌟"); + } + } else + { WriteFailedBuild(); + } + WriteNormal(); } @@ -98,8 +116,15 @@ string CreateLine(string target, string executionStatus, string duration, string + duration.PadLeft(thirdColumn, paddingChar: ' ') + (appendix != null ? $"   // {appendix}" : string.Empty); - static string ToMinutesAndSeconds(TimeSpan duration) - => $"{(int) duration.TotalMinutes}:{duration:ss}"; + static string GetDurationOrBlank(ExecutableTarget target) + => target.Status == ExecutionStatus.Executed || + target.Status == ExecutionStatus.Failed || + target.Status == ExecutionStatus.Aborted + ? GetDuration(target.Duration) + : string.Empty; + + static string GetDuration(TimeSpan duration) + => $"{(int) duration.TotalMinutes}:{duration:ss}".Replace("0:00", "< 1sec"); WriteNormal(new string(c: '═', count: allColumns)); WriteInformation(CreateLine("Target", "Status", "Duration")); @@ -107,7 +132,7 @@ static string ToMinutesAndSeconds(TimeSpan duration) WriteNormal(new string(c: '─', count: allColumns)); foreach (var target in build.ExecutionPlan) { - var line = CreateLine(target.Name, target.Status.ToString(), ToMinutesAndSeconds(target.Duration), target.SkipReason); + var line = CreateLine(target.Name, target.Status.ToString(), GetDurationOrBlank(target), target.SkipReason); switch (target.Status) { case ExecutionStatus.Skipped: @@ -127,7 +152,7 @@ static string ToMinutesAndSeconds(TimeSpan duration) } WriteNormal(new string(c: '─', count: allColumns)); - WriteInformation(CreateLine("Total", "", ToMinutesAndSeconds(totalDuration))); + WriteInformation(CreateLine("Total", string.Empty, GetDuration(totalDuration))); WriteNormal(new string(c: '═', count: allColumns)); } diff --git a/source/Nuke.Common/Tooling/LatestMyGetVersionAttribute.cs b/source/Nuke.Common/Tooling/LatestMyGetVersionAttribute.cs index 81427bcf2..b9c7e0ff8 100644 --- a/source/Nuke.Common/Tooling/LatestMyGetVersionAttribute.cs +++ b/source/Nuke.Common/Tooling/LatestMyGetVersionAttribute.cs @@ -30,7 +30,7 @@ public override object GetValue(MemberInfo member, object instance) HttpTasks.HttpDownloadFile($"https://www.myget.org/RSS/{_feed}", rssFile); return XmlTasks.XmlPeek(rssFile, ".//title") // TODO: regex? - .First(x => x.Contains($" {_package} ")) + .First(x => x.Contains($"/{_package} ")) .Split('(').Last() .Split(')').First() .TrimStart("version "); diff --git a/source/Nuke.Common/Tooling/ToolPathResolver.cs b/source/Nuke.Common/Tooling/ToolPathResolver.cs index 3f7cca2ff..264093920 100644 --- a/source/Nuke.Common/Tooling/ToolPathResolver.cs +++ b/source/Nuke.Common/Tooling/ToolPathResolver.cs @@ -16,7 +16,7 @@ namespace Nuke.Common.Tooling [PublicAPI] public static class ToolPathResolver { - public static string ExecutingAssemblyDirectory; + public static string EmbeddedPackagesDirectory; public static string NuGetPackagesConfigFile; public static string NuGetAssetsConfigFile; public static string PaketPackagesConfigFile; @@ -94,8 +94,8 @@ private static string GetPackageDirectory(string[] packageIds, [CanBeNull] strin .SelectMany(x => new Func[] { - () => ExecutingAssemblyDirectory != null - ? Path.Combine(ExecutingAssemblyDirectory, x) + () => EmbeddedPackagesDirectory != null + ? Path.Combine(EmbeddedPackagesDirectory, x) : null, () => NuGetAssetsConfigFile != null ? NuGetPackageResolver.GetLocalInstalledPackage(x, NuGetAssetsConfigFile, version)?.Directory @@ -120,7 +120,7 @@ private static string GetPackageDirectory(string[] packageIds, [CanBeNull] strin new[] { NukeBuild.BuildProjectDirectory == null - ? $"Embedded packages directory at '{ExecutingAssemblyDirectory}'" + ? $"Embedded packages directory at '{EmbeddedPackagesDirectory}'" : null, NuGetAssetsConfigFile != null ? $"Project assets file '{NuGetAssetsConfigFile}'" diff --git a/source/Nuke.Common/Tools/Coverlet/Coverlet.Generated.cs b/source/Nuke.Common/Tools/Coverlet/Coverlet.Generated.cs index 5bf77d468..c1dd6a9cf 100644 --- a/source/Nuke.Common/Tools/Coverlet/Coverlet.Generated.cs +++ b/source/Nuke.Common/Tools/Coverlet/Coverlet.Generated.cs @@ -1034,7 +1034,7 @@ public static T ToggleUseSourceLink(this T toolSettings) where T : DotNetTest public partial class CoverletOutputFormat : Enumeration { public static CoverletOutputFormat json = (CoverletOutputFormat) "json"; - public static CoverletOutputFormat Icov = (CoverletOutputFormat) "Icov"; + public static CoverletOutputFormat lcov = (CoverletOutputFormat) "lcov"; public static CoverletOutputFormat opencover = (CoverletOutputFormat) "opencover"; public static CoverletOutputFormat cobertura = (CoverletOutputFormat) "cobertura"; public static CoverletOutputFormat teamcity = (CoverletOutputFormat) "teamcity"; diff --git a/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs b/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs index 57a944fd5..806bc4f59 100644 --- a/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs +++ b/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs @@ -393,7 +393,7 @@ public static IReadOnlyCollection DotNetRestore(Configure--serviceable via ///
  • --source via
  • ///
  • --use-lock-file via
  • - ///
  • --verbosity via
  • + ///
  • --verbosity via
  • ///
  • --version-suffix via
  • ///
  • /property via
  • /// @@ -433,7 +433,7 @@ public static IReadOnlyCollection DotNetPack(DotNetPackSettings toolSett ///
  • --serviceable via
  • ///
  • --source via
  • ///
  • --use-lock-file via
  • - ///
  • --verbosity via
  • + ///
  • --verbosity via
  • ///
  • --version-suffix via
  • ///
  • /property via
  • /// @@ -470,7 +470,7 @@ public static IReadOnlyCollection DotNetPack(Configure--serviceable via ///
  • --source via
  • ///
  • --use-lock-file via
  • - ///
  • --verbosity via
  • + ///
  • --verbosity via
  • ///
  • --version-suffix via
  • ///
  • /property via
  • /// @@ -680,6 +680,7 @@ public static IReadOnlyCollection DotNetClean(Configure--no-cache via ///
  • --no-dependencies via
  • ///
  • --no-restore via
  • + ///
  • --nologo via
  • ///
  • --output via
  • ///
  • --packages via
  • ///
  • --runtime via
  • @@ -719,6 +720,7 @@ public static IReadOnlyCollection DotNetPublish(DotNetPublishSettings to ///
  • --no-cache via
  • ///
  • --no-dependencies via
  • ///
  • --no-restore via
  • + ///
  • --nologo via
  • ///
  • --output via
  • ///
  • --packages via
  • ///
  • --runtime via
  • @@ -755,6 +757,7 @@ public static IReadOnlyCollection DotNetPublish(Configure--no-cache via ///
  • --no-dependencies via
  • ///
  • --no-restore via
  • + ///
  • --nologo via
  • ///
  • --output via
  • ///
  • --packages via
  • ///
  • --runtime via
  • @@ -1543,7 +1546,7 @@ public partial class DotNetPackSettings : ToolSettings /// /// Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. /// - public virtual DotNetVerbosity Verbostiy { get; internal set; } + public virtual DotNetVerbosity Verbosity { get; internal set; } /// /// Defines the value for the $(VersionSuffix) MSBuild property in the project. /// @@ -1618,7 +1621,7 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) .Add("--no-restore", NoRestore) .Add("--output {value}", OutputDirectory) .Add("--serviceable", Serviceable) - .Add("--verbosity {value}", Verbostiy) + .Add("--verbosity {value}", Verbosity) .Add("--version-suffix {value}", VersionSuffix) .Add("--nologo", NoLogo) .Add("--disable-parallel", DisableParallel) @@ -1905,6 +1908,10 @@ public partial class DotNetPublishSettings : ToolSettings ///
    public virtual string VersionSuffix { get; internal set; } /// + /// Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK. + /// + public virtual bool? NoLogo { get; internal set; } + /// /// Disables restoring multiple projects in parallel. /// public virtual bool? DisableParallel { get; internal set; } @@ -1969,6 +1976,7 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) .Add("--runtime {value}", Runtime) .Add("--verbosity {value}", Verbosity) .Add("--version-suffix {value}", VersionSuffix) + .Add("--nologo", NoLogo) .Add("--disable-parallel", DisableParallel) .Add("--force", Force) .Add("--ignore-failed-sources", IgnoreFailedSources) @@ -5334,6 +5342,201 @@ public static T ResetSymbolPackageFormat(this T toolSettings) where T : DotNe return toolSettings; } #endregion + #region PublishReadyToRun + /// + ///

    Sets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T SetPublishReadyToRun(this T toolSettings, bool? publishReadyToRun) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishReadyToRun"] = publishReadyToRun; + return toolSettings; + } + /// + ///

    Resets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T ResetPublishReadyToRun(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishReadyToRun"); + return toolSettings; + } + /// + ///

    Enables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishReadyToRun(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishReadyToRun"] = true; + return toolSettings; + } + /// + ///

    Disables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishReadyToRun(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishReadyToRun"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishReadyToRun(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishReadyToRun"); + return toolSettings; + } + #endregion + #region PublishSingleFile + /// + ///

    Sets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T SetPublishSingleFile(this T toolSettings, bool? publishSingleFile) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishSingleFile"] = publishSingleFile; + return toolSettings; + } + /// + ///

    Resets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T ResetPublishSingleFile(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishSingleFile"); + return toolSettings; + } + /// + ///

    Enables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishSingleFile(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishSingleFile"] = true; + return toolSettings; + } + /// + ///

    Disables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishSingleFile(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishSingleFile"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishSingleFile(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishSingleFile"); + return toolSettings; + } + #endregion + #region PublishTrimmed + /// + ///

    Sets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T SetPublishTrimmed(this T toolSettings, bool? publishTrimmed) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = publishTrimmed; + return toolSettings; + } + /// + ///

    Resets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T ResetPublishTrimmed(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishTrimmed"); + return toolSettings; + } + /// + ///

    Enables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishTrimmed(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = true; + return toolSettings; + } + /// + ///

    Disables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishTrimmed(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishTrimmed(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishTrimmed"); + return toolSettings; + } + #endregion + #region PublishProfile + /// + ///

    Sets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPublishProfile(this T toolSettings, string publishProfile) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishProfile"] = publishProfile; + return toolSettings; + } + /// + ///

    Resets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetPublishProfile(this T toolSettings) where T : DotNetRunSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishProfile"); + return toolSettings; + } + #endregion #endregion } #endregion @@ -6977,211 +7180,406 @@ public static T ResetSymbolPackageFormat(this T toolSettings) where T : DotNe return toolSettings; } #endregion - #endregion - } - #endregion - #region DotNetPackSettingsExtensions - /// - /// Used within . - /// - [PublicAPI] - [ExcludeFromCodeCoverage] - public static partial class DotNetPackSettingsExtensions - { - #region Project + #region PublishReadyToRun /// - ///

    Sets

    - ///

    The project to pack. It's either a path to a csproj file or to a directory. If omitted, it defaults to the current directory.

    + ///

    Sets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetProject(this T toolSettings, string project) where T : DotNetPackSettings + public static T SetPublishReadyToRun(this T toolSettings, bool? publishReadyToRun) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Project = project; + toolSettings.PropertiesInternal["PublishReadyToRun"] = publishReadyToRun; return toolSettings; } /// - ///

    Resets

    - ///

    The project to pack. It's either a path to a csproj file or to a directory. If omitted, it defaults to the current directory.

    + ///

    Resets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetProject(this T toolSettings) where T : DotNetPackSettings + public static T ResetPublishReadyToRun(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Project = null; + toolSettings.PropertiesInternal.Remove("PublishReadyToRun"); return toolSettings; } - #endregion - #region Configuration /// - ///

    Sets

    - ///

    Configuration to use when building the project. If not specified, configuration defaults to Debug.

    + ///

    Enables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetConfiguration(this T toolSettings, string configuration) where T : DotNetPackSettings + public static T EnablePublishReadyToRun(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Configuration = configuration; + toolSettings.PropertiesInternal["PublishReadyToRun"] = true; return toolSettings; } /// - ///

    Resets

    - ///

    Configuration to use when building the project. If not specified, configuration defaults to Debug.

    + ///

    Disables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetConfiguration(this T toolSettings) where T : DotNetPackSettings + public static T DisablePublishReadyToRun(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Configuration = null; + toolSettings.PropertiesInternal["PublishReadyToRun"] = false; return toolSettings; } - #endregion - #region IncludeSource /// - ///

    Sets

    - ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///

    Toggles PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetIncludeSource(this T toolSettings, bool? includeSource) where T : DotNetPackSettings + public static T TogglePublishReadyToRun(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSource = includeSource; + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishReadyToRun"); return toolSettings; } + #endregion + #region PublishSingleFile /// - ///

    Resets

    - ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///

    Sets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetIncludeSource(this T toolSettings) where T : DotNetPackSettings + public static T SetPublishSingleFile(this T toolSettings, bool? publishSingleFile) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSource = null; + toolSettings.PropertiesInternal["PublishSingleFile"] = publishSingleFile; return toolSettings; } /// - ///

    Enables

    - ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///

    Resets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T EnableIncludeSource(this T toolSettings) where T : DotNetPackSettings + public static T ResetPublishSingleFile(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSource = true; + toolSettings.PropertiesInternal.Remove("PublishSingleFile"); return toolSettings; } /// - ///

    Disables

    - ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///

    Enables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T DisableIncludeSource(this T toolSettings) where T : DotNetPackSettings + public static T EnablePublishSingleFile(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSource = false; + toolSettings.PropertiesInternal["PublishSingleFile"] = true; return toolSettings; } /// - ///

    Toggles

    - ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///

    Disables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ToggleIncludeSource(this T toolSettings) where T : DotNetPackSettings + public static T DisablePublishSingleFile(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSource = !toolSettings.IncludeSource; + toolSettings.PropertiesInternal["PublishSingleFile"] = false; return toolSettings; } - #endregion - #region IncludeSymbols /// - ///

    Sets

    - ///

    Generates the symbols nupkg.

    + ///

    Toggles PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetIncludeSymbols(this T toolSettings, bool? includeSymbols) where T : DotNetPackSettings + public static T TogglePublishSingleFile(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSymbols = includeSymbols; + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishSingleFile"); return toolSettings; } + #endregion + #region PublishTrimmed /// - ///

    Resets

    - ///

    Generates the symbols nupkg.

    + ///

    Sets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + public static T SetPublishTrimmed(this T toolSettings, bool? publishTrimmed) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSymbols = null; + toolSettings.PropertiesInternal["PublishTrimmed"] = publishTrimmed; return toolSettings; } /// - ///

    Enables

    - ///

    Generates the symbols nupkg.

    + ///

    Resets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T EnableIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + public static T ResetPublishTrimmed(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSymbols = true; + toolSettings.PropertiesInternal.Remove("PublishTrimmed"); return toolSettings; } /// - ///

    Disables

    - ///

    Generates the symbols nupkg.

    + ///

    Enables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T DisableIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + public static T EnablePublishTrimmed(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSymbols = false; + toolSettings.PropertiesInternal["PublishTrimmed"] = true; return toolSettings; } /// - ///

    Toggles

    - ///

    Generates the symbols nupkg.

    + ///

    Disables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ToggleIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + public static T DisablePublishTrimmed(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeSymbols = !toolSettings.IncludeSymbols; + toolSettings.PropertiesInternal["PublishTrimmed"] = false; return toolSettings; } - #endregion - #region NoBuild /// - ///

    Sets

    - ///

    Don't build the project before packing.

    + ///

    Toggles PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetNoBuild(this T toolSettings, bool? noBuild) where T : DotNetPackSettings + public static T TogglePublishTrimmed(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoBuild = noBuild; + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishTrimmed"); return toolSettings; } + #endregion + #region PublishProfile /// - ///

    Resets

    - ///

    Don't build the project before packing.

    + ///

    Sets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetNoBuild(this T toolSettings) where T : DotNetPackSettings + public static T SetPublishProfile(this T toolSettings, string publishProfile) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoBuild = null; + toolSettings.PropertiesInternal["PublishProfile"] = publishProfile; return toolSettings; } /// - ///

    Enables

    - ///

    Don't build the project before packing.

    + ///

    Resets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T EnableNoBuild(this T toolSettings) where T : DotNetPackSettings + public static T ResetPublishProfile(this T toolSettings) where T : DotNetRestoreSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoBuild = true; + toolSettings.PropertiesInternal.Remove("PublishProfile"); + return toolSettings; + } + #endregion + #endregion + } + #endregion + #region DotNetPackSettingsExtensions + /// + /// Used within . + /// + [PublicAPI] + [ExcludeFromCodeCoverage] + public static partial class DotNetPackSettingsExtensions + { + #region Project + /// + ///

    Sets

    + ///

    The project to pack. It's either a path to a csproj file or to a directory. If omitted, it defaults to the current directory.

    + ///
    + [Pure] + public static T SetProject(this T toolSettings, string project) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Project = project; + return toolSettings; + } + /// + ///

    Resets

    + ///

    The project to pack. It's either a path to a csproj file or to a directory. If omitted, it defaults to the current directory.

    + ///
    + [Pure] + public static T ResetProject(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Project = null; + return toolSettings; + } + #endregion + #region Configuration + /// + ///

    Sets

    + ///

    Configuration to use when building the project. If not specified, configuration defaults to Debug.

    + ///
    + [Pure] + public static T SetConfiguration(this T toolSettings, string configuration) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Configuration = configuration; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Configuration to use when building the project. If not specified, configuration defaults to Debug.

    + ///
    + [Pure] + public static T ResetConfiguration(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Configuration = null; + return toolSettings; + } + #endregion + #region IncludeSource + /// + ///

    Sets

    + ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///
    + [Pure] + public static T SetIncludeSource(this T toolSettings, bool? includeSource) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSource = includeSource; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///
    + [Pure] + public static T ResetIncludeSource(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSource = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///
    + [Pure] + public static T EnableIncludeSource(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSource = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///
    + [Pure] + public static T DisableIncludeSource(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSource = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    Includes the source files in the NuGet package. The sources files are included in the src folder within the nupkg.

    + ///
    + [Pure] + public static T ToggleIncludeSource(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSource = !toolSettings.IncludeSource; + return toolSettings; + } + #endregion + #region IncludeSymbols + /// + ///

    Sets

    + ///

    Generates the symbols nupkg.

    + ///
    + [Pure] + public static T SetIncludeSymbols(this T toolSettings, bool? includeSymbols) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSymbols = includeSymbols; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Generates the symbols nupkg.

    + ///
    + [Pure] + public static T ResetIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSymbols = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Generates the symbols nupkg.

    + ///
    + [Pure] + public static T EnableIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSymbols = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    Generates the symbols nupkg.

    + ///
    + [Pure] + public static T DisableIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSymbols = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    Generates the symbols nupkg.

    + ///
    + [Pure] + public static T ToggleIncludeSymbols(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.IncludeSymbols = !toolSettings.IncludeSymbols; + return toolSettings; + } + #endregion + #region NoBuild + /// + ///

    Sets

    + ///

    Don't build the project before packing.

    + ///
    + [Pure] + public static T SetNoBuild(this T toolSettings, bool? noBuild) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoBuild = noBuild; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Don't build the project before packing.

    + ///
    + [Pure] + public static T ResetNoBuild(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoBuild = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Don't build the project before packing.

    + ///
    + [Pure] + public static T EnableNoBuild(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoBuild = true; return toolSettings; } /// @@ -7345,27 +7743,27 @@ public static T ToggleServiceable(this T toolSettings) where T : DotNetPackSe return toolSettings; } #endregion - #region Verbostiy + #region Verbosity /// - ///

    Sets

    + ///

    Sets

    ///

    Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

    ///
    [Pure] - public static T SetVerbostiy(this T toolSettings, DotNetVerbosity verbostiy) where T : DotNetPackSettings + public static T SetVerbosity(this T toolSettings, DotNetVerbosity verbosity) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Verbostiy = verbostiy; + toolSettings.Verbosity = verbosity; return toolSettings; } /// - ///

    Resets

    + ///

    Resets

    ///

    Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

    ///
    [Pure] - public static T ResetVerbostiy(this T toolSettings) where T : DotNetPackSettings + public static T ResetVerbosity(this T toolSettings) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Verbostiy = null; + toolSettings.Verbosity = null; return toolSettings; } #endregion @@ -9010,115 +9408,310 @@ public static T ResetSymbolPackageFormat(this T toolSettings) where T : DotNe return toolSettings; } #endregion - #endregion - } - #endregion - #region DotNetBuildSettingsExtensions - /// - /// Used within . - /// - [PublicAPI] - [ExcludeFromCodeCoverage] - public static partial class DotNetBuildSettingsExtensions - { - #region ProjectFile + #region PublishReadyToRun /// - ///

    Sets

    - ///

    The project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///

    Sets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetProjectFile(this T toolSettings, string projectFile) where T : DotNetBuildSettings + public static T SetPublishReadyToRun(this T toolSettings, bool? publishReadyToRun) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ProjectFile = projectFile; + toolSettings.PropertiesInternal["PublishReadyToRun"] = publishReadyToRun; return toolSettings; } /// - ///

    Resets

    - ///

    The project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///

    Resets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetProjectFile(this T toolSettings) where T : DotNetBuildSettings + public static T ResetPublishReadyToRun(this T toolSettings) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ProjectFile = null; + toolSettings.PropertiesInternal.Remove("PublishReadyToRun"); return toolSettings; } - #endregion - #region Configuration /// - ///

    Sets

    - ///

    Defines the build configuration. If omitted, the build configuration defaults to Debug. Use Release build a Release configuration.

    + ///

    Enables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetConfiguration(this T toolSettings, string configuration) where T : DotNetBuildSettings + public static T EnablePublishReadyToRun(this T toolSettings) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Configuration = configuration; + toolSettings.PropertiesInternal["PublishReadyToRun"] = true; return toolSettings; } /// - ///

    Resets

    - ///

    Defines the build configuration. If omitted, the build configuration defaults to Debug. Use Release build a Release configuration.

    + ///

    Disables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetConfiguration(this T toolSettings) where T : DotNetBuildSettings + public static T DisablePublishReadyToRun(this T toolSettings) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Configuration = null; + toolSettings.PropertiesInternal["PublishReadyToRun"] = false; return toolSettings; } - #endregion - #region Framework /// - ///

    Sets

    - ///

    Compiles for a specific framework. The framework must be defined in the project file.

    + ///

    Toggles PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetFramework(this T toolSettings, string framework) where T : DotNetBuildSettings + public static T TogglePublishReadyToRun(this T toolSettings) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Framework = framework; + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishReadyToRun"); return toolSettings; } + #endregion + #region PublishSingleFile /// - ///

    Resets

    - ///

    Compiles for a specific framework. The framework must be defined in the project file.

    + ///

    Sets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetFramework(this T toolSettings) where T : DotNetBuildSettings + public static T SetPublishSingleFile(this T toolSettings, bool? publishSingleFile) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Framework = null; + toolSettings.PropertiesInternal["PublishSingleFile"] = publishSingleFile; return toolSettings; } - #endregion - #region NoIncremental /// - ///

    Sets

    - ///

    Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.

    + ///

    Resets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetNoIncremental(this T toolSettings, bool? noIncremental) where T : DotNetBuildSettings + public static T ResetPublishSingleFile(this T toolSettings) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoIncremental = noIncremental; + toolSettings.PropertiesInternal.Remove("PublishSingleFile"); return toolSettings; } /// - ///

    Resets

    - ///

    Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.

    + ///

    Enables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetNoIncremental(this T toolSettings) where T : DotNetBuildSettings + public static T EnablePublishSingleFile(this T toolSettings) where T : DotNetPackSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoIncremental = null; + toolSettings.PropertiesInternal["PublishSingleFile"] = true; return toolSettings; } /// - ///

    Enables

    - ///

    Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.

    + ///

    Disables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishSingleFile(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishSingleFile"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishSingleFile(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishSingleFile"); + return toolSettings; + } + #endregion + #region PublishTrimmed + /// + ///

    Sets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T SetPublishTrimmed(this T toolSettings, bool? publishTrimmed) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = publishTrimmed; + return toolSettings; + } + /// + ///

    Resets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T ResetPublishTrimmed(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishTrimmed"); + return toolSettings; + } + /// + ///

    Enables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishTrimmed(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = true; + return toolSettings; + } + /// + ///

    Disables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishTrimmed(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishTrimmed(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishTrimmed"); + return toolSettings; + } + #endregion + #region PublishProfile + /// + ///

    Sets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPublishProfile(this T toolSettings, string publishProfile) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishProfile"] = publishProfile; + return toolSettings; + } + /// + ///

    Resets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetPublishProfile(this T toolSettings) where T : DotNetPackSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishProfile"); + return toolSettings; + } + #endregion + #endregion + } + #endregion + #region DotNetBuildSettingsExtensions + /// + /// Used within . + /// + [PublicAPI] + [ExcludeFromCodeCoverage] + public static partial class DotNetBuildSettingsExtensions + { + #region ProjectFile + /// + ///

    Sets

    + ///

    The project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///
    + [Pure] + public static T SetProjectFile(this T toolSettings, string projectFile) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.ProjectFile = projectFile; + return toolSettings; + } + /// + ///

    Resets

    + ///

    The project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///
    + [Pure] + public static T ResetProjectFile(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.ProjectFile = null; + return toolSettings; + } + #endregion + #region Configuration + /// + ///

    Sets

    + ///

    Defines the build configuration. If omitted, the build configuration defaults to Debug. Use Release build a Release configuration.

    + ///
    + [Pure] + public static T SetConfiguration(this T toolSettings, string configuration) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Configuration = configuration; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Defines the build configuration. If omitted, the build configuration defaults to Debug. Use Release build a Release configuration.

    + ///
    + [Pure] + public static T ResetConfiguration(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Configuration = null; + return toolSettings; + } + #endregion + #region Framework + /// + ///

    Sets

    + ///

    Compiles for a specific framework. The framework must be defined in the project file.

    + ///
    + [Pure] + public static T SetFramework(this T toolSettings, string framework) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Framework = framework; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Compiles for a specific framework. The framework must be defined in the project file.

    + ///
    + [Pure] + public static T ResetFramework(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Framework = null; + return toolSettings; + } + #endregion + #region NoIncremental + /// + ///

    Sets

    + ///

    Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.

    + ///
    + [Pure] + public static T SetNoIncremental(this T toolSettings, bool? noIncremental) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoIncremental = noIncremental; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.

    + ///
    + [Pure] + public static T ResetNoIncremental(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoIncremental = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.

    ///
    [Pure] public static T EnableNoIncremental(this T toolSettings) where T : DotNetBuildSettings @@ -11034,158 +11627,353 @@ public static T ResetSymbolPackageFormat(this T toolSettings) where T : DotNe return toolSettings; } #endregion - #endregion - } - #endregion - #region DotNetCleanSettingsExtensions - /// - /// Used within . - /// - [PublicAPI] - [ExcludeFromCodeCoverage] - public static partial class DotNetCleanSettingsExtensions - { - #region Project + #region PublishReadyToRun /// - ///

    Sets

    - ///

    The MSBuild project to clean. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///

    Sets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetProject(this T toolSettings, string project) where T : DotNetCleanSettings + public static T SetPublishReadyToRun(this T toolSettings, bool? publishReadyToRun) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Project = project; + toolSettings.PropertiesInternal["PublishReadyToRun"] = publishReadyToRun; return toolSettings; } /// - ///

    Resets

    - ///

    The MSBuild project to clean. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///

    Resets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetProject(this T toolSettings) where T : DotNetCleanSettings + public static T ResetPublishReadyToRun(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Project = null; + toolSettings.PropertiesInternal.Remove("PublishReadyToRun"); return toolSettings; } - #endregion - #region Configuration /// - ///

    Sets

    - ///

    Defines the build configuration. The default value is Debug. This option is only required when cleaning if you specified it during build time.

    + ///

    Enables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetConfiguration(this T toolSettings, string configuration) where T : DotNetCleanSettings + public static T EnablePublishReadyToRun(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Configuration = configuration; + toolSettings.PropertiesInternal["PublishReadyToRun"] = true; return toolSettings; } /// - ///

    Resets

    - ///

    Defines the build configuration. The default value is Debug. This option is only required when cleaning if you specified it during build time.

    + ///

    Disables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetConfiguration(this T toolSettings) where T : DotNetCleanSettings + public static T DisablePublishReadyToRun(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Configuration = null; + toolSettings.PropertiesInternal["PublishReadyToRun"] = false; return toolSettings; } - #endregion - #region Framework /// - ///

    Sets

    - ///

    The framework that was specified at build time. The framework must be defined in the project file. If you specified the framework at build time, you must specify the framework when cleaning.

    + ///

    Toggles PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetFramework(this T toolSettings, string framework) where T : DotNetCleanSettings + public static T TogglePublishReadyToRun(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Framework = framework; + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishReadyToRun"); return toolSettings; } + #endregion + #region PublishSingleFile /// - ///

    Resets

    - ///

    The framework that was specified at build time. The framework must be defined in the project file. If you specified the framework at build time, you must specify the framework when cleaning.

    + ///

    Sets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetFramework(this T toolSettings) where T : DotNetCleanSettings + public static T SetPublishSingleFile(this T toolSettings, bool? publishSingleFile) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Framework = null; + toolSettings.PropertiesInternal["PublishSingleFile"] = publishSingleFile; return toolSettings; } - #endregion - #region Output /// - ///

    Sets

    - ///

    Directory in which the build outputs are placed. Specify the --framework switch with the output directory switch if you specified the framework when the project was built.

    + ///

    Resets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetOutput(this T toolSettings, string output) where T : DotNetCleanSettings + public static T ResetPublishSingleFile(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Output = output; + toolSettings.PropertiesInternal.Remove("PublishSingleFile"); return toolSettings; } /// - ///

    Resets

    - ///

    Directory in which the build outputs are placed. Specify the --framework switch with the output directory switch if you specified the framework when the project was built.

    + ///

    Enables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetOutput(this T toolSettings) where T : DotNetCleanSettings + public static T EnablePublishSingleFile(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Output = null; + toolSettings.PropertiesInternal["PublishSingleFile"] = true; return toolSettings; } - #endregion - #region Runtime /// - ///

    Sets

    - ///

    Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created.

    + ///

    Disables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetRuntime(this T toolSettings, string runtime) where T : DotNetCleanSettings + public static T DisablePublishSingleFile(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Runtime = runtime; + toolSettings.PropertiesInternal["PublishSingleFile"] = false; return toolSettings; } /// - ///

    Resets

    - ///

    Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created.

    + ///

    Toggles PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetRuntime(this T toolSettings) where T : DotNetCleanSettings + public static T TogglePublishSingleFile(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Runtime = null; + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishSingleFile"); return toolSettings; } #endregion - #region Verbosity + #region PublishTrimmed /// - ///

    Sets

    - ///

    Sets the verbosity level of the command. Allowed levels are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

    + ///

    Sets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetVerbosity(this T toolSettings, DotNetVerbosity verbosity) where T : DotNetCleanSettings + public static T SetPublishTrimmed(this T toolSettings, bool? publishTrimmed) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Verbosity = verbosity; + toolSettings.PropertiesInternal["PublishTrimmed"] = publishTrimmed; return toolSettings; } /// - ///

    Resets

    - ///

    Sets the verbosity level of the command. Allowed levels are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

    + ///

    Resets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetVerbosity(this T toolSettings) where T : DotNetCleanSettings + public static T ResetPublishTrimmed(this T toolSettings) where T : DotNetBuildSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Verbosity = null; + toolSettings.PropertiesInternal.Remove("PublishTrimmed"); + return toolSettings; + } + /// + ///

    Enables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishTrimmed(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = true; + return toolSettings; + } + /// + ///

    Disables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishTrimmed(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishTrimmed(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishTrimmed"); + return toolSettings; + } + #endregion + #region PublishProfile + /// + ///

    Sets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPublishProfile(this T toolSettings, string publishProfile) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishProfile"] = publishProfile; + return toolSettings; + } + /// + ///

    Resets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetPublishProfile(this T toolSettings) where T : DotNetBuildSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishProfile"); + return toolSettings; + } + #endregion + #endregion + } + #endregion + #region DotNetCleanSettingsExtensions + /// + /// Used within . + /// + [PublicAPI] + [ExcludeFromCodeCoverage] + public static partial class DotNetCleanSettingsExtensions + { + #region Project + /// + ///

    Sets

    + ///

    The MSBuild project to clean. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///
    + [Pure] + public static T SetProject(this T toolSettings, string project) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Project = project; + return toolSettings; + } + /// + ///

    Resets

    + ///

    The MSBuild project to clean. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj and uses that file.

    + ///
    + [Pure] + public static T ResetProject(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Project = null; + return toolSettings; + } + #endregion + #region Configuration + /// + ///

    Sets

    + ///

    Defines the build configuration. The default value is Debug. This option is only required when cleaning if you specified it during build time.

    + ///
    + [Pure] + public static T SetConfiguration(this T toolSettings, string configuration) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Configuration = configuration; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Defines the build configuration. The default value is Debug. This option is only required when cleaning if you specified it during build time.

    + ///
    + [Pure] + public static T ResetConfiguration(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Configuration = null; + return toolSettings; + } + #endregion + #region Framework + /// + ///

    Sets

    + ///

    The framework that was specified at build time. The framework must be defined in the project file. If you specified the framework at build time, you must specify the framework when cleaning.

    + ///
    + [Pure] + public static T SetFramework(this T toolSettings, string framework) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Framework = framework; + return toolSettings; + } + /// + ///

    Resets

    + ///

    The framework that was specified at build time. The framework must be defined in the project file. If you specified the framework at build time, you must specify the framework when cleaning.

    + ///
    + [Pure] + public static T ResetFramework(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Framework = null; + return toolSettings; + } + #endregion + #region Output + /// + ///

    Sets

    + ///

    Directory in which the build outputs are placed. Specify the --framework switch with the output directory switch if you specified the framework when the project was built.

    + ///
    + [Pure] + public static T SetOutput(this T toolSettings, string output) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Output = output; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Directory in which the build outputs are placed. Specify the --framework switch with the output directory switch if you specified the framework when the project was built.

    + ///
    + [Pure] + public static T ResetOutput(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Output = null; + return toolSettings; + } + #endregion + #region Runtime + /// + ///

    Sets

    + ///

    Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created.

    + ///
    + [Pure] + public static T SetRuntime(this T toolSettings, string runtime) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Runtime = runtime; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created.

    + ///
    + [Pure] + public static T ResetRuntime(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Runtime = null; + return toolSettings; + } + #endregion + #region Verbosity + /// + ///

    Sets

    + ///

    Sets the verbosity level of the command. Allowed levels are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

    + ///
    + [Pure] + public static T SetVerbosity(this T toolSettings, DotNetVerbosity verbosity) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Verbosity = verbosity; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Sets the verbosity level of the command. Allowed levels are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

    + ///
    + [Pure] + public static T ResetVerbosity(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Verbosity = null; return toolSettings; } #endregion @@ -11994,206 +12782,401 @@ public static T SetPackageProjectUrl(this T toolSettings, string packageProje public static T ResetPackageProjectUrl(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal.Remove("PackageProjectUrl"); + toolSettings.PropertiesInternal.Remove("PackageProjectUrl"); + return toolSettings; + } + #endregion + #region PackageIconUrl + /// + ///

    Sets PackageIconUrl in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPackageIconUrl(this T toolSettings, string packageIconUrl) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PackageIconUrl"] = packageIconUrl; + return toolSettings; + } + /// + ///

    Resets PackageIconUrl in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetPackageIconUrl(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PackageIconUrl"); + return toolSettings; + } + #endregion + #region PackageTags + /// + ///

    Sets PackageTags in to a new collection

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPackageTags(this T toolSettings, params string[] packageTags) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.SetCollection(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + return toolSettings; + } + /// + ///

    Sets PackageTags in to a new collection

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPackageTags(this T toolSettings, IEnumerable packageTags) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.SetCollection(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + return toolSettings; + } + /// + ///

    Adds values to PackageTags in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T AddPackageTags(this T toolSettings, params string[] packageTags) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.AddItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + return toolSettings; + } + /// + ///

    Adds values to PackageTags in existing

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T AddPackageTags(this T toolSettings, IEnumerable packageTags) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.AddItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + return toolSettings; + } + /// + ///

    Clears PackageTags in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ClearPackageTags(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PackageTags"); + return toolSettings; + } + /// + ///

    Removes values from PackageTags in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T RemovePackageTags(this T toolSettings, params string[] packageTags) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.RemoveItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + return toolSettings; + } + /// + ///

    Removes values from PackageTags in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T RemovePackageTags(this T toolSettings, IEnumerable packageTags) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.RemoveItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + return toolSettings; + } + #endregion + #region PackageReleaseNotes + /// + ///

    Sets PackageReleaseNotes in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPackageReleaseNotes(this T toolSettings, string packageReleaseNotes) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PackageReleaseNotes"] = packageReleaseNotes; + return toolSettings; + } + /// + ///

    Resets PackageReleaseNotes in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetPackageReleaseNotes(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PackageReleaseNotes"); + return toolSettings; + } + #endregion + #region RepositoryUrl + /// + ///

    Sets RepositoryUrl in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetRepositoryUrl(this T toolSettings, string repositoryUrl) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["RepositoryUrl"] = repositoryUrl; + return toolSettings; + } + /// + ///

    Resets RepositoryUrl in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetRepositoryUrl(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("RepositoryUrl"); + return toolSettings; + } + #endregion + #region RepositoryType + /// + ///

    Sets RepositoryType in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetRepositoryType(this T toolSettings, string repositoryType) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["RepositoryType"] = repositoryType; + return toolSettings; + } + /// + ///

    Resets RepositoryType in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetRepositoryType(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("RepositoryType"); + return toolSettings; + } + #endregion + #region SymbolPackageFormat + /// + ///

    Sets SymbolPackageFormat in

    + ///

    Format for packaging symbols.

    + ///
    + [Pure] + public static T SetSymbolPackageFormat(this T toolSettings, DotNetSymbolPackageFormat symbolPackageFormat) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["SymbolPackageFormat"] = symbolPackageFormat; + return toolSettings; + } + /// + ///

    Resets SymbolPackageFormat in

    + ///

    Format for packaging symbols.

    + ///
    + [Pure] + public static T ResetSymbolPackageFormat(this T toolSettings) where T : DotNetCleanSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("SymbolPackageFormat"); return toolSettings; } #endregion - #region PackageIconUrl + #region PublishReadyToRun /// - ///

    Sets PackageIconUrl in

    - ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///

    Sets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetPackageIconUrl(this T toolSettings, string packageIconUrl) where T : DotNetCleanSettings + public static T SetPublishReadyToRun(this T toolSettings, bool? publishReadyToRun) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal["PackageIconUrl"] = packageIconUrl; + toolSettings.PropertiesInternal["PublishReadyToRun"] = publishReadyToRun; return toolSettings; } /// - ///

    Resets PackageIconUrl in

    - ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///

    Resets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetPackageIconUrl(this T toolSettings) where T : DotNetCleanSettings + public static T ResetPublishReadyToRun(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal.Remove("PackageIconUrl"); + toolSettings.PropertiesInternal.Remove("PublishReadyToRun"); return toolSettings; } - #endregion - #region PackageTags /// - ///

    Sets PackageTags in to a new collection

    + ///

    Enables PublishReadyToRun in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetPackageTags(this T toolSettings, params string[] packageTags) where T : DotNetCleanSettings + public static T EnablePublishReadyToRun(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - ExtensionHelper.SetCollection(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + toolSettings.PropertiesInternal["PublishReadyToRun"] = true; return toolSettings; } /// - ///

    Sets PackageTags in to a new collection

    + ///

    Disables PublishReadyToRun in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetPackageTags(this T toolSettings, IEnumerable packageTags) where T : DotNetCleanSettings + public static T DisablePublishReadyToRun(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - ExtensionHelper.SetCollection(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + toolSettings.PropertiesInternal["PublishReadyToRun"] = false; return toolSettings; } /// - ///

    Adds values to PackageTags in

    + ///

    Toggles PublishReadyToRun in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T AddPackageTags(this T toolSettings, params string[] packageTags) where T : DotNetCleanSettings + public static T TogglePublishReadyToRun(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - ExtensionHelper.AddItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishReadyToRun"); return toolSettings; } + #endregion + #region PublishSingleFile /// - ///

    Adds values to PackageTags in existing

    - ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///

    Sets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T AddPackageTags(this T toolSettings, IEnumerable packageTags) where T : DotNetCleanSettings + public static T SetPublishSingleFile(this T toolSettings, bool? publishSingleFile) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - ExtensionHelper.AddItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + toolSettings.PropertiesInternal["PublishSingleFile"] = publishSingleFile; return toolSettings; } /// - ///

    Clears PackageTags in

    - ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///

    Resets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ClearPackageTags(this T toolSettings) where T : DotNetCleanSettings + public static T ResetPublishSingleFile(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal.Remove("PackageTags"); + toolSettings.PropertiesInternal.Remove("PublishSingleFile"); return toolSettings; } /// - ///

    Removes values from PackageTags in

    + ///

    Enables PublishSingleFile in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T RemovePackageTags(this T toolSettings, params string[] packageTags) where T : DotNetCleanSettings + public static T EnablePublishSingleFile(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - ExtensionHelper.RemoveItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + toolSettings.PropertiesInternal["PublishSingleFile"] = true; return toolSettings; } /// - ///

    Removes values from PackageTags in

    + ///

    Disables PublishSingleFile in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T RemovePackageTags(this T toolSettings, IEnumerable packageTags) where T : DotNetCleanSettings + public static T DisablePublishSingleFile(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - ExtensionHelper.RemoveItems(toolSettings.PropertiesInternal, "PackageTags", packageTags, ' '); + toolSettings.PropertiesInternal["PublishSingleFile"] = false; return toolSettings; } - #endregion - #region PackageReleaseNotes /// - ///

    Sets PackageReleaseNotes in

    + ///

    Toggles PublishSingleFile in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetPackageReleaseNotes(this T toolSettings, string packageReleaseNotes) where T : DotNetCleanSettings + public static T TogglePublishSingleFile(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal["PackageReleaseNotes"] = packageReleaseNotes; + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishSingleFile"); return toolSettings; } + #endregion + #region PublishTrimmed /// - ///

    Resets PackageReleaseNotes in

    - ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///

    Sets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T ResetPackageReleaseNotes(this T toolSettings) where T : DotNetCleanSettings + public static T SetPublishTrimmed(this T toolSettings, bool? publishTrimmed) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal.Remove("PackageReleaseNotes"); + toolSettings.PropertiesInternal["PublishTrimmed"] = publishTrimmed; return toolSettings; } - #endregion - #region RepositoryUrl /// - ///

    Sets RepositoryUrl in

    - ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///

    Resets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    ///
    [Pure] - public static T SetRepositoryUrl(this T toolSettings, string repositoryUrl) where T : DotNetCleanSettings + public static T ResetPublishTrimmed(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal["RepositoryUrl"] = repositoryUrl; + toolSettings.PropertiesInternal.Remove("PublishTrimmed"); return toolSettings; } /// - ///

    Resets RepositoryUrl in

    + ///

    Enables PublishTrimmed in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetRepositoryUrl(this T toolSettings) where T : DotNetCleanSettings + public static T EnablePublishTrimmed(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal.Remove("RepositoryUrl"); + toolSettings.PropertiesInternal["PublishTrimmed"] = true; return toolSettings; } - #endregion - #region RepositoryType /// - ///

    Sets RepositoryType in

    + ///

    Disables PublishTrimmed in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetRepositoryType(this T toolSettings, string repositoryType) where T : DotNetCleanSettings + public static T DisablePublishTrimmed(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal["RepositoryType"] = repositoryType; + toolSettings.PropertiesInternal["PublishTrimmed"] = false; return toolSettings; } /// - ///

    Resets RepositoryType in

    + ///

    Toggles PublishTrimmed in

    ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetRepositoryType(this T toolSettings) where T : DotNetCleanSettings + public static T TogglePublishTrimmed(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal.Remove("RepositoryType"); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishTrimmed"); return toolSettings; } #endregion - #region SymbolPackageFormat + #region PublishProfile /// - ///

    Sets SymbolPackageFormat in

    - ///

    Format for packaging symbols.

    + ///

    Sets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T SetSymbolPackageFormat(this T toolSettings, DotNetSymbolPackageFormat symbolPackageFormat) where T : DotNetCleanSettings + public static T SetPublishProfile(this T toolSettings, string publishProfile) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal["SymbolPackageFormat"] = symbolPackageFormat; + toolSettings.PropertiesInternal["PublishProfile"] = publishProfile; return toolSettings; } /// - ///

    Resets SymbolPackageFormat in

    - ///

    Format for packaging symbols.

    + ///

    Resets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    ///
    [Pure] - public static T ResetSymbolPackageFormat(this T toolSettings) where T : DotNetCleanSettings + public static T ResetPublishProfile(this T toolSettings) where T : DotNetCleanSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.PropertiesInternal.Remove("SymbolPackageFormat"); + toolSettings.PropertiesInternal.Remove("PublishProfile"); return toolSettings; } #endregion @@ -12571,6 +13554,63 @@ public static T ResetVersionSuffix(this T toolSettings) where T : DotNetPubli return toolSettings; } #endregion + #region NoLogo + /// + ///

    Sets

    + ///

    Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK.

    + ///
    + [Pure] + public static T SetNoLogo(this T toolSettings, bool? noLogo) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoLogo = noLogo; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK.

    + ///
    + [Pure] + public static T ResetNoLogo(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoLogo = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK.

    + ///
    + [Pure] + public static T EnableNoLogo(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoLogo = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK.

    + ///
    + [Pure] + public static T DisableNoLogo(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoLogo = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK.

    + ///
    + [Pure] + public static T ToggleNoLogo(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoLogo = !toolSettings.NoLogo; + return toolSettings; + } + #endregion #region DisableParallel /// ///

    Sets

    @@ -14107,6 +15147,201 @@ public static T ResetSymbolPackageFormat(this T toolSettings) where T : DotNe return toolSettings; } #endregion + #region PublishReadyToRun + /// + ///

    Sets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T SetPublishReadyToRun(this T toolSettings, bool? publishReadyToRun) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishReadyToRun"] = publishReadyToRun; + return toolSettings; + } + /// + ///

    Resets PublishReadyToRun in

    + ///

    Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. For more information, see ReadyToRun images. Available since .NET Core 3.0 SDK.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T ResetPublishReadyToRun(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishReadyToRun"); + return toolSettings; + } + /// + ///

    Enables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishReadyToRun(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishReadyToRun"] = true; + return toolSettings; + } + /// + ///

    Disables PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishReadyToRun(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishReadyToRun"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishReadyToRun in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishReadyToRun(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishReadyToRun"); + return toolSettings; + } + #endregion + #region PublishSingleFile + /// + ///

    Sets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T SetPublishSingleFile(this T toolSettings, bool? publishSingleFile) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishSingleFile"] = publishSingleFile; + return toolSettings; + } + /// + ///

    Resets PublishSingleFile in

    + ///

    Packages the app into a platform-specific single-file executable. The executable is self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run, the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application is run again. The application doesn't need to extract itself a second time unless a new version is used. Available since .NET Core 3.0 SDK. For more information about single-file publishing, see the single-file bundler design document.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T ResetPublishSingleFile(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishSingleFile"); + return toolSettings; + } + /// + ///

    Enables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishSingleFile(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishSingleFile"] = true; + return toolSettings; + } + /// + ///

    Disables PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishSingleFile(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishSingleFile"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishSingleFile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishSingleFile(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishSingleFile"); + return toolSettings; + } + #endregion + #region PublishTrimmed + /// + ///

    Sets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T SetPublishTrimmed(this T toolSettings, bool? publishTrimmed) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = publishTrimmed; + return toolSettings; + } + /// + ///

    Resets PublishTrimmed in

    + ///

    Trims unused libraries to reduce the deployment size of an app when publishing a self-contained executable. For more information, see Trim self-contained deployments and executables. Available since .NET Core 3.0 SDK as a preview feature.We recommend that you specify this option in a publish profile rather than on the command line. For more information, see MSBuild.

    + ///
    + [Pure] + public static T ResetPublishTrimmed(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishTrimmed"); + return toolSettings; + } + /// + ///

    Enables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T EnablePublishTrimmed(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = true; + return toolSettings; + } + /// + ///

    Disables PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T DisablePublishTrimmed(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishTrimmed"] = false; + return toolSettings; + } + /// + ///

    Toggles PublishTrimmed in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T TogglePublishTrimmed(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + ExtensionHelper.ToggleBoolean(toolSettings.PropertiesInternal, "PublishTrimmed"); + return toolSettings; + } + #endregion + #region PublishProfile + /// + ///

    Sets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T SetPublishProfile(this T toolSettings, string publishProfile) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal["PublishProfile"] = publishProfile; + return toolSettings; + } + /// + ///

    Resets PublishProfile in

    + ///

    Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

    /property:WarningLevel=2;OutDir=bin\Debug

    + ///
    + [Pure] + public static T ResetPublishProfile(this T toolSettings) where T : DotNetPublishSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.PropertiesInternal.Remove("PublishProfile"); + return toolSettings; + } + #endregion #endregion } #endregion diff --git a/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs b/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs index 9bfb0df1b..2b7bd0b2d 100644 --- a/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs +++ b/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs @@ -31,7 +31,7 @@ public static partial class OctopusTasks ///
    public static string OctopusPath => ToolPathResolver.TryGetEnvironmentExecutable("OCTOPUS_EXE") ?? - GetProcessToolPath(); + GetToolPath(); public static Action OctopusLogger { get; set; } = ProcessTasks.DefaultLogger; /// ///

    Octopus Deploy is an automated deployment server, which you install yourself, much like you would install SQL Server, Team Foundation Server or JetBrains TeamCity. Octopus makes it easy to automate deployment of ASP.NET web applications and Windows Services into development, test and production environments.Along with the Octopus Deploy server, you'll also install a lightweight agent service on each of the machines that you plan to deploy to, for example your web and application servers. We call this the Tentacle agent; the idea being that one Octopus server controls many Tentacles, potentially a lot more than 8! With Octopus and Tentacle, you can easily deploy to your own servers, or cloud services from providers like Amazon Web Services or Microsoft Azure.

    diff --git a/source/Nuke.Common/Tools/Octopus/OctopusTasks.cs b/source/Nuke.Common/Tools/Octopus/OctopusTasks.cs index ecd5771e5..6cda9b5bb 100644 --- a/source/Nuke.Common/Tools/Octopus/OctopusTasks.cs +++ b/source/Nuke.Common/Tools/Octopus/OctopusTasks.cs @@ -10,7 +10,7 @@ public partial class OctopusBuildInformationSettings { private string GetProcessToolPath() { - return OctopusTasks.GetProcessToolPath(Framework); + return OctopusTasks.GetToolPath(Framework); } } @@ -18,7 +18,7 @@ public partial class OctopusPackSettings { private string GetProcessToolPath() { - return OctopusTasks.GetProcessToolPath(Framework); + return OctopusTasks.GetToolPath(Framework); } } @@ -26,7 +26,7 @@ public partial class OctopusPushSettings { private string GetProcessToolPath() { - return OctopusTasks.GetProcessToolPath(Framework); + return OctopusTasks.GetToolPath(Framework); } } @@ -34,7 +34,7 @@ public partial class OctopusCreateReleaseSettings { private string GetProcessToolPath() { - return OctopusTasks.GetProcessToolPath(Framework); + return OctopusTasks.GetToolPath(Framework); } } @@ -42,13 +42,13 @@ public partial class OctopusDeployReleaseSettings { private string GetProcessToolPath() { - return OctopusTasks.GetProcessToolPath(Framework); + return OctopusTasks.GetToolPath(Framework); } } public partial class OctopusTasks { - internal static string GetProcessToolPath(string framework = null) + internal static string GetToolPath(string framework = null) { return ToolPathResolver.GetPackageExecutable( packageId: "OctopusTools|Octopus.DotNet.Cli", diff --git a/source/Nuke.Common/Tools/ReSharper/ReSharper.Generated.cs b/source/Nuke.Common/Tools/ReSharper/ReSharper.Generated.cs index b52bb1fac..5f4611ee3 100644 --- a/source/Nuke.Common/Tools/ReSharper/ReSharper.Generated.cs +++ b/source/Nuke.Common/Tools/ReSharper/ReSharper.Generated.cs @@ -30,7 +30,7 @@ public static partial class ReSharperTasks ///
    public static string ReSharperPath => ToolPathResolver.TryGetEnvironmentExecutable("RESHARPER_EXE") ?? - ToolPathResolver.GetPackageExecutable("JetBrains.ReSharper.GlobalTools", "JetBrains.CommandLine.Products.exe"); + ToolPathResolver.GetPackageExecutable("JetBrains.ReSharper.GlobalTools", "JetBrains.CommandLine.Products.dll"); public static Action ReSharperLogger { get; set; } = ProcessTasks.DefaultLogger; /// ///

    For more details, visit the official website.

    diff --git a/source/Nuke.Common/Tools/SignPath/SignPathTasks.cs b/source/Nuke.Common/Tools/SignPath/SignPathTasks.cs index 393db98e8..4d3ba31d2 100644 --- a/source/Nuke.Common/Tools/SignPath/SignPathTasks.cs +++ b/source/Nuke.Common/Tools/SignPath/SignPathTasks.cs @@ -47,16 +47,16 @@ public static string GetSigningRequestUrl(string organizationId, string signingR return $"{SignPathApiUrl}/{organizationId}/SignRequests/{signingRequestId}"; } - private static string GetSignPathAppVeyorIntegrationUrl(string organizationId, string projectKey, string signingPolicyKey) + private static string GetSignPathAppVeyorIntegrationUrl(string organizationId, string projectSlug, string signingPolicySlug) { - return $"{SignPathApiUrl}/{organizationId}/Integrations/AppVeyor?ProjectKey={projectKey}&SigningPolicyKey={signingPolicyKey}"; + return $"{SignPathApiUrl}/{organizationId}/Integrations/AppVeyor?ProjectSlug={projectSlug}&SigningPolicySlug={signingPolicySlug}"; } public static async Task GetSigningRequestUrlViaAppVeyor( string authToken, string organizationId, - string projectKey, - string signingPolicyKey) + string projectSlug, + string signingPolicySlug) { using (SwitchSecurityProtocol()) { @@ -72,9 +72,9 @@ public static async Task GetSigningRequestUrlViaAppVeyor( using var httpClient = CreateAuthorizedHttpClient(authToken, DefaultHttpClientTimeout); var response = await httpClient.PostAsync( - GetSignPathAppVeyorIntegrationUrl(organizationId, projectKey, signingPolicyKey), + GetSignPathAppVeyorIntegrationUrl(organizationId, projectSlug, signingPolicySlug), new StringContent(JsonSerialize(content), Encoding.UTF8, contentType)); - Assert(response.StatusCode == HttpStatusCode.Created, $"{response.StatusCode} == HttpStatusCode.Created"); + Assert(response.StatusCode == HttpStatusCode.Created, response.Content.ReadAsStringAsync().GetAwaiter().GetResult()); Logger.Info($"Signing request created: {response.Headers.Location.AbsoluteUri.Replace("api/v1", "Web")}"); return response.Headers.Location.AbsoluteUri; @@ -86,9 +86,9 @@ public static async Task GetSigningRequestUrlViaAppVeyor( // string organizationId, // string artifactConfigurationId, // string signingPolicyId, - // string projectKey, - // string artifactConfigurationKey, - // string signingPolicyKey, + // string projectSlug, + // string artifactConfigurationSlug, + // string signingPolicySlug, // string inputArtifactPath, // string description, // string apiUrl = "https://app.signpath.io/api/v1") @@ -106,7 +106,7 @@ public static async Task GetSigningRequestUrlViaAppVeyor( // var submitUrl = $"{apiUrl}/{organizationId}/SigningRequests"; // var getUrl = SubmitVia( // uploadAndDownloadHttpClient, - // submitUrl, projectKey, signingPolicyKey, signingPolicyId, description, artifactConfigurationId, artifactConfigurationKey, + // submitUrl, projectSlug, signingPolicySlug, signingPolicyId, description, artifactConfigurationId, artifactConfigurationSlug, // inputArtifactPath); // // var downloadUrl = GetSignedArtifactUrl( @@ -216,12 +216,12 @@ private static HttpResponseMessage SendGetRequestWithRetry(HttpClient httpClient private static string SubmitVia( HttpClient httpClient, string url, - [CanBeNull] string projectKey, - [CanBeNull] string signingPolicyKey, + [CanBeNull] string projectSlug, + [CanBeNull] string signingPolicySlug, [CanBeNull] string signingPolicyId, string description, [CanBeNull] string artifactConfigurationId, - [CanBeNull] string artifactConfigurationKey, + [CanBeNull] string artifactConfigurationSlug, string artifactFile) { StreamContent GetStreamContent() @@ -241,9 +241,9 @@ HttpRequestMessage CreateHttpRequest() { (nameof(artifactConfigurationId), artifactConfigurationId), (nameof(signingPolicyId), signingPolicyId), - (nameof(projectKey), projectKey), - (nameof(artifactConfigurationKey), artifactConfigurationKey), - (nameof(signingPolicyKey), signingPolicyKey), + (nameof(projectSlug), projectSlug), + (nameof(artifactConfigurationSlug), artifactConfigurationSlug), + (nameof(signingPolicySlug), signingPolicySlug), (nameof(description), description) } .Where(x => x.Item2 != null).ToList(); diff --git a/source/Nuke.Common/ValueInjection/ParameterService.cs b/source/Nuke.Common/ValueInjection/ParameterService.cs index 9b39d6cbe..85f86d193 100644 --- a/source/Nuke.Common/ValueInjection/ParameterService.cs +++ b/source/Nuke.Common/ValueInjection/ParameterService.cs @@ -85,9 +85,9 @@ public static string GetParameterDescription(MemberInfo member) .SingleOrDefault() .NotNull($"No single provider '{attribute.ValueProvider}' found for member '{member.Name}'."); ControlFlow.Assert(valueProvider.GetMemberType() == typeof(IEnumerable), - "valueProvider.GetReturnType() == typeof(IEnumerable)"); + $"Value provider '{valueProvider.Name}' must be of type '{typeof(IEnumerable).GetDisplayShortName()}'."); - return valueProvider.GetValue>(instance); + return valueProvider.GetValue>(instance).Select(x => (x, (object) x)); } IEnumerable<(string Text, object Object)> TryGetFromEnumerationClass() => diff --git a/source/Nuke.Components/ISignPackages.cs b/source/Nuke.Components/ISignPackages.cs index f2893bbb6..188ba36dd 100644 --- a/source/Nuke.Components/ISignPackages.cs +++ b/source/Nuke.Components/ISignPackages.cs @@ -17,16 +17,46 @@ namespace Nuke.Components { + /// + /// This component allows to easily sign NuGet packages with + /// SignPath and + /// AppVeyor. + /// + /// + /// + /// To implement this interface, proceed as follows: + ///
      + ///
    • Register for an open-source account at sig.fo
    • + ///
    • Generate or copy the Bearer token at ci.appveyor.com/api-keys
    • + ///
    • Add AppVeyor as a trusted build system
    • + ///
    • Provide the Bearer token and set signing-request.zip as the artifact path
    • + ///
    • Create a CI user and assign it as submitter for the signing policy
    • + ///
    • Encrypt the generated API token at ci.appveyor.com/tools/encrypt
    • + ///
    • Provide an artifact configuration
    • + ///
    • + /// Extend the appveyor.yml with all necessary data + /// + /// environment: + /// SignPathApiToken: + /// secure: <encrypted-api-token> + /// SignPathOrganizationId: <organization-id> + /// SignPathProjectSlug: <project-Slug> + /// SignPathPolicySlug: <policy-Slug> + /// + ///
    • + ///
    + ///
    + ///
    public interface ISignPackages : INukeBuild { [Parameter] string SignPathApiToken => ValueInjectionUtility.TryGetValue(() => SignPathApiToken); [Parameter] string SignPathOrganizationId => ValueInjectionUtility.TryGetValue(() => SignPathOrganizationId); - [Parameter] string SignPathProjectKey => ValueInjectionUtility.TryGetValue(() => SignPathProjectKey); - [Parameter] string SignPathPolicyKey => ValueInjectionUtility.TryGetValue(() => SignPathPolicyKey); + [Parameter] string SignPathProjectSlug => ValueInjectionUtility.TryGetValue(() => SignPathProjectSlug); + [Parameter] string SignPathPolicySlug => ValueInjectionUtility.TryGetValue(() => SignPathPolicySlug); - AbsolutePath SignPathTemporaryDirectory => TemporaryDirectory / $"signpath"; - AbsolutePath SignPathRequestDirectory => SignPathTemporaryDirectory / "sign-request"; - AbsolutePath SignPathResponseDirectory => SignPathTemporaryDirectory / "sign-response"; + AbsolutePath SignPathTemporaryDirectory => TemporaryDirectory / "signpath"; + AbsolutePath SignPathRequestDirectory => SignPathTemporaryDirectory / "signing-request"; + AbsolutePath SignPathResponseDirectory => SignPathTemporaryDirectory / "signing-response"; string SignPathRequestArchive => Path.ChangeExtension(SignPathRequestDirectory, ".zip"); string SignPathResponseArchive => Path.ChangeExtension(SignPathRequestDirectory, ".zip"); @@ -39,8 +69,8 @@ public interface ISignPackages : INukeBuild .OnlyWhenStatic(() => AppVeyor != null) .Requires(() => SignPathApiToken) .Requires(() => SignPathOrganizationId) - .Requires(() => SignPathProjectKey) - .Requires(() => SignPathPolicyKey) + .Requires(() => SignPathProjectSlug) + .Requires(() => SignPathPolicySlug) .Executes(async () => { EnsureCleanDirectory(SignPathTemporaryDirectory); @@ -52,8 +82,8 @@ public interface ISignPackages : INukeBuild var signingRequestUrl = await GetSigningRequestUrlViaAppVeyor( SignPathApiToken, SignPathOrganizationId, - SignPathProjectKey, - SignPathPolicyKey); + SignPathProjectSlug, + SignPathPolicySlug); await DownloadSignedArtifactFromUrl( SignPathApiToken, signingRequestUrl, diff --git a/source/Nuke.GlobalTool.Tests/Nuke.GlobalTool.Tests.csproj b/source/Nuke.GlobalTool.Tests/Nuke.GlobalTool.Tests.csproj index 423e62cf0..a7a2b1187 100644 --- a/source/Nuke.GlobalTool.Tests/Nuke.GlobalTool.Tests.csproj +++ b/source/Nuke.GlobalTool.Tests/Nuke.GlobalTool.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + net5.0 diff --git a/source/Nuke.GlobalTool/templates/_build.sdk.csproj b/source/Nuke.GlobalTool/templates/_build.sdk.csproj index e0986e652..c61934cc7 100644 --- a/source/Nuke.GlobalTool/templates/_build.sdk.csproj +++ b/source/Nuke.GlobalTool/templates/_build.sdk.csproj @@ -11,7 +11,7 @@ - // GITVERSION + // GITVERSION diff --git a/source/Nuke.GlobalTool/templates/build.cmd b/source/Nuke.GlobalTool/templates/build.cmd index 4a72f9bcf..8b8b89dc9 100644 --- a/source/Nuke.GlobalTool/templates/build.cmd +++ b/source/Nuke.GlobalTool/templates/build.cmd @@ -4,4 +4,4 @@ :; exit $? @ECHO OFF -powershell -ExecutionPolicy ByPass -NoProfile %0\..\build.ps1 %* +powershell -ExecutionPolicy ByPass -NoProfile "%~dp0build.ps1" %* diff --git a/source/Nuke.MSBuildTasks/PackPackageToolsTask.cs b/source/Nuke.MSBuildTasks/PackPackageToolsTask.cs index f1bf32e11..0830c4d3c 100644 --- a/source/Nuke.MSBuildTasks/PackPackageToolsTask.cs +++ b/source/Nuke.MSBuildTasks/PackPackageToolsTask.cs @@ -9,6 +9,7 @@ using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; +using Nuke.Common; using Nuke.Common.Tooling; using static Nuke.Common.IO.PathConstruction; @@ -38,11 +39,11 @@ protected override bool ExecuteInner() private IEnumerable GetFiles(string packageId, string packageVersion) { - var packageToolsPath = Path.Combine(NuGetPackageRoot, packageId, packageVersion, "tools"); - if (!Directory.Exists(packageToolsPath)) + var packageToolsDirectory = Path.Combine(NuGetPackageRoot, packageId.ToLowerInvariant(), packageVersion.ToLowerInvariant(), "tools"); + if (!Directory.Exists(packageToolsDirectory)) yield break; - foreach (var file in Directory.GetFiles(packageToolsPath, "*", SearchOption.AllDirectories)) + foreach (var file in Directory.GetFiles(packageToolsDirectory, "*", SearchOption.AllDirectories)) { var taskItem = new TaskItem(file); taskItem.SetMetadata("BuildAction", "None"); @@ -52,7 +53,7 @@ private IEnumerable GetFiles(string packageId, string packageVersion) TargetFramework, "any", packageId, - GetRelativePath(packageToolsPath, file))); + GetRelativePath(packageToolsDirectory, file))); yield return taskItem; } }