diff --git a/Tasks/DotNetCoreCLIV2/README.md b/Tasks/DotNetCoreCLIV2/README.md index a87018c2064a..519eaf8eef82 100644 --- a/Tasks/DotNetCoreCLIV2/README.md +++ b/Tasks/DotNetCoreCLIV2/README.md @@ -35,6 +35,8 @@ Options specific to **dotnet pack** command * **Configuration to Package\*:** When using a csproj file this specifies the configuration to package. * **Package Folder\*:** Folder where packages will be created. If empty, packages will be created alongside the csproj file. * **Do not build\*:** Don't build the project before packing. Corresponds to the --no-build command line parameter. +* **Include Symbols\*:** Additionally creates symbol NuGet packages. Corresponds to the --include-symbols command line parameter. +* **Include Source\*:** Includes source code in the package. Corresponds to the --include-source command line parameter. * **Automatic package versioning\*:** Cannot be used with include referenced projects. If you choose 'Use the date and time', this will generate a SemVer -compliant version formatted as X.Y.Z-ci-datetime where you choose X, Y, and Z. If you choose 'Use an environment variable', you must select an environment variable and ensure it contains the version number you want to use. If you choose 'Use the build number', this will use the build number to version your package. Note: Under Options set the build number format to be '$(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) diff --git a/Tasks/DotNetCoreCLIV2/Strings/resources.resjson/en-US/resources.resjson b/Tasks/DotNetCoreCLIV2/Strings/resources.resjson/en-US/resources.resjson index 1b53c216cb76..5a3349b829d6 100644 --- a/Tasks/DotNetCoreCLIV2/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/DotNetCoreCLIV2/Strings/resources.resjson/en-US/resources.resjson @@ -61,6 +61,10 @@ "loc.input.help.outputDir": "Folder where packages will be created. If empty, packages will be created alongside the csproj file.", "loc.input.label.nobuild": "Do not build", "loc.input.help.nobuild": "Don't build the project before packing. Corresponds to the --no-build command line parameter.", + "loc.input.label.includesymbols": "Include Symbols", + "loc.input.help.includesymbols": "Additionally creates symbol NuGet packages. Corresponds to the --include-symbols command line parameter.", + "loc.input.label.includesource": "Include Source", + "loc.input.help.includesource": "Includes source code in the package. Corresponds to the --include-source command line parameter.", "loc.input.label.versioningScheme": "Automatic package versioning", "loc.input.help.versioningScheme": "Cannot be used with include referenced projects. If you choose 'Use the date and time', this will generate a [SemVer](http://semver.org/spec/v1.0.0.html)-compliant version formatted as `X.Y.Z-ci-datetime` where you choose X, Y, and Z.\n\nIf you choose 'Use an environment variable', you must select an environment variable and ensure it contains the version number you want to use.\n\nIf you choose 'Use the build number', this will use the build number to version your package. **Note:** Under Options set the build number format to be '[$(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)](https://go.microsoft.com/fwlink/?LinkID=627416)'.", "loc.input.label.versionEnvVar": "Environment variable", diff --git a/Tasks/DotNetCoreCLIV2/packcommand.ts b/Tasks/DotNetCoreCLIV2/packcommand.ts index 36ba01f384e0..c09a32f5c812 100644 --- a/Tasks/DotNetCoreCLIV2/packcommand.ts +++ b/Tasks/DotNetCoreCLIV2/packcommand.ts @@ -18,6 +18,8 @@ export async function run(): Promise { let propertiesInput = tl.getInput("buildProperties"); let verbosity = tl.getInput("verbosityPack"); let nobuild = tl.getBoolInput("nobuild"); + let includeSymbols = tl.getBoolInput("includesymbols"); + let includeSource = tl.getBoolInput("includesource"); let outputDir = undefined; try { @@ -124,7 +126,7 @@ export async function run(): Promise { const dotnetPath = tl.which("dotnet", true); for (const file of filesList) { - await dotnetPackAsync(dotnetPath, file, outputDir, nobuild, version, props, verbosity); + await dotnetPackAsync(dotnetPath, file, outputDir, nobuild, includeSymbols, includeSource, version, props, verbosity); } } catch (err) { tl.error(err); @@ -132,7 +134,7 @@ export async function run(): Promise { } } -function dotnetPackAsync(dotnetPath: string, packageFile: string, outputDir: string, nobuild: boolean, version: string, properties: string[], verbosity: string): Q.Promise { +function dotnetPackAsync(dotnetPath: string, packageFile: string, outputDir: string, nobuild: boolean, includeSymbols: boolean, includeSource: boolean, version: string, properties: string[], verbosity: string): Q.Promise { let dotnet = tl.tool(dotnetPath); dotnet.arg("pack"); @@ -147,6 +149,14 @@ function dotnetPackAsync(dotnetPath: string, packageFile: string, outputDir: str dotnet.arg("--no-build"); } + if (includeSymbols) { + dotnet.arg("--include-symbols"); + } + + if (includeSource) { + dotnet.arg("--include-source"); + } + if (properties && properties.length > 0) { dotnet.arg("/p:" + properties.join(";")); } diff --git a/Tasks/DotNetCoreCLIV2/task.json b/Tasks/DotNetCoreCLIV2/task.json index 121f9502ccc4..8e53665d8f85 100644 --- a/Tasks/DotNetCoreCLIV2/task.json +++ b/Tasks/DotNetCoreCLIV2/task.json @@ -17,8 +17,8 @@ "demands": [], "version": { "Major": 2, - "Minor": 151, - "Patch": 1 + "Minor": 152, + "Patch": 0 }, "minimumAgentVersion": "2.115.0", "instanceNameFormat": "dotnet $(command)", @@ -367,6 +367,24 @@ "required": false, "visibleRule": "command = pack" }, + { + "name": "includesymbols", + "type": "boolean", + "label": "Include Symbols", + "defaultValue": "false", + "helpMarkDown": "Additionally creates symbol NuGet packages. Corresponds to the --include-symbols command line parameter.", + "required": false, + "visibleRule": "command = pack" + }, + { + "name": "includesource", + "type": "boolean", + "label": "Include Source", + "defaultValue": "false", + "helpMarkDown": "Includes source code in the package. Corresponds to the --include-source command line parameter.", + "required": false, + "visibleRule": "command = pack" + }, { "name": "versioningScheme", "type": "pickList", diff --git a/Tasks/DotNetCoreCLIV2/task.loc.json b/Tasks/DotNetCoreCLIV2/task.loc.json index 27f6a091f4db..9c351b163013 100644 --- a/Tasks/DotNetCoreCLIV2/task.loc.json +++ b/Tasks/DotNetCoreCLIV2/task.loc.json @@ -17,8 +17,8 @@ "demands": [], "version": { "Major": 2, - "Minor": 151, - "Patch": 1 + "Minor": 152, + "Patch": 0 }, "minimumAgentVersion": "2.115.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat", @@ -367,6 +367,24 @@ "required": false, "visibleRule": "command = pack" }, + { + "name": "includesymbols", + "type": "boolean", + "label": "ms-resource:loc.input.label.includesymbols", + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.includesymbols", + "required": false, + "visibleRule": "command = pack" + }, + { + "name": "includesource", + "type": "boolean", + "label": "ms-resource:loc.input.label.includesource", + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.includesource", + "required": false, + "visibleRule": "command = pack" + }, { "name": "versioningScheme", "type": "pickList",