Skip to content

Commit bcbc0c9

Browse files
authored
Adding Checkbox and updating webdeployment common package version in … (#20602)
* Adding Checkbox and updating webdeployment common package version in FiletransformV2 * updated task.loc.json file * Adding default value
1 parent ab11e35 commit bcbc0c9

File tree

20 files changed

+297
-252
lines changed

20 files changed

+297
-252
lines changed

Tasks/FileTransformV2/_buildConfigs/Node20/package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tasks/FileTransformV2/_buildConfigs/Node20/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/mocha": "^5.2.7",
2121
"@types/node": "^20.3.1",
2222
"@types/q": "1.0.7",
23-
"azure-pipelines-tasks-webdeployment-common": "4.243.1",
23+
"azure-pipelines-tasks-webdeployment-common": "4.247.0",
2424
"q": "1.4.1"
2525
},
2626
"devDependencies": {

Tasks/FileTransformV2/filetransform.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ async function main() {
1010
tl.setResourcePath(path.join( __dirname, 'node_modules/azure-pipelines-tasks-webdeployment-common/module.json'));
1111
let webPackage = new Package(tl.getPathInput('folderPath', true));
1212
let packagePath = webPackage.getPath();
13-
let xmlTransformation = true;
13+
let xmlTransformation = tl.getBoolInput('enableXmlTransform', false);
1414
let xmlTransformationRules = tl.getDelimitedInput('xmlTransformationRules', '\n', false);
1515
let xmlTargetFiles = tl.getDelimitedInput('xmlTargetFiles', '\n', false);
1616
let jsonTargetFiles = tl.getDelimitedInput('jsonTargetFiles', '\n', false);
17-
if(xmlTransformationRules.length == 0) {
18-
xmlTransformation = false;
19-
}
2017

2118
if ( xmlTransformation || xmlTargetFiles.length != 0 || jsonTargetFiles.length != 0) {
2219
let isFolderBasedDeployment: boolean = tl.stats(packagePath).isDirectory();

Tasks/FileTransformV2/package-lock.json

Lines changed: 100 additions & 100 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tasks/FileTransformV2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/mocha": "^5.2.7",
2121
"@types/node": "16.11.39",
2222
"@types/q": "1.0.7",
23-
"azure-pipelines-tasks-webdeployment-common": "4.243.1",
23+
"azure-pipelines-tasks-webdeployment-common": "4.247.0",
2424
"q": "1.4.1"
2525
},
2626
"devDependencies": {

Tasks/FileTransformV2/task.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
],
1818
"version": {
1919
"Major": 2,
20-
"Minor": 246,
20+
"Minor": 248,
2121
"Patch": 0
2222
},
23-
"preview": "true",
2423
"releaseNotes": "More optimized task fields that allow users to enable any/all of the transformation (XML), variable substitution (JSON and XML) features in a single task instance.</br>Task fails when any of the configured transformation/substitution is NOT applied or when the task is no-op.",
2524
"instanceNameFormat": "File Transform: $(Package)",
2625
"groups": [
@@ -39,13 +38,22 @@
3938
"required": true,
4039
"helpMarkDown": "File path to the package or a folder.<br />Variables ( [Build](https://docs.microsoft.com/vsts/pipelines/build/variables) | [Release](https://docs.microsoft.com/vsts/pipelines/release/variables#default-variables)), wildcards are supported. <br/> For example, $(System.DefaultWorkingDirectory)/\\*\\*/\\*.zip."
4140
},
41+
{
42+
"name": "enableXmlTransform",
43+
"type": "boolean",
44+
"label": "XML transformation",
45+
"required": false,
46+
"defaultValue": true,
47+
"helpMarkDown": "Config transforms will be run prior to the Variable Substitution.<br/>XML transformations are supported only for Windows platform."
48+
},
4249
{
4350
"name": "xmlTransformationRules",
4451
"type": "multiLine",
4552
"label": "XML Transformation rules",
4653
"defaultValue": "-transform **\\*.Release.config -xml **\\*.config",
4754
"required": false,
48-
"helpMarkDown": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile> -xml <pathToSourceConfigurationFile>"
55+
"helpMarkDown": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile> -xml <pathToSourceConfigurationFile>",
56+
"visibleRule": "enableXmlTransform == true"
4957
},
5058
{
5159
"name": "jsonTargetFiles",

Tasks/FileTransformV2/task.loc.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
],
1818
"version": {
1919
"Major": 2,
20-
"Minor": 246,
20+
"Minor": 248,
2121
"Patch": 0
2222
},
23-
"preview": "true",
2423
"releaseNotes": "ms-resource:loc.releaseNotes",
2524
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
2625
"groups": [
@@ -39,13 +38,22 @@
3938
"required": true,
4039
"helpMarkDown": "ms-resource:loc.input.help.folderPath"
4140
},
41+
{
42+
"name": "enableXmlTransform",
43+
"type": "boolean",
44+
"label": "ms-resource:loc.input.label.enableXmlTransform",
45+
"required": false,
46+
"defaultValue": true,
47+
"helpMarkDown": "ms-resource:loc.input.help.enableXmlTransform"
48+
},
4249
{
4350
"name": "xmlTransformationRules",
4451
"type": "multiLine",
4552
"label": "ms-resource:loc.input.label.xmlTransformationRules",
4653
"defaultValue": "-transform **\\*.Release.config -xml **\\*.config",
4754
"required": false,
48-
"helpMarkDown": "ms-resource:loc.input.help.xmlTransformationRules"
55+
"helpMarkDown": "ms-resource:loc.input.help.xmlTransformationRules",
56+
"visibleRule": "enableXmlTransform == true"
4957
},
5058
{
5159
"name": "jsonTargetFiles",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Default|2.246.0
2-
Node20_229_3|2.246.1
1+
Default|2.248.0
2+
Node20_229_3|2.248.1

_generated/FileTransformV2/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"loc.group.displayName.VariableSubstitution": "Variable Substitution",
88
"loc.input.label.folderPath": "Package or folder",
99
"loc.input.help.folderPath": "File path to the package or a folder.<br />Variables ( [Build](https://docs.microsoft.com/vsts/pipelines/build/variables) | [Release](https://docs.microsoft.com/vsts/pipelines/release/variables#default-variables)), wildcards are supported. <br/> For example, $(System.DefaultWorkingDirectory)/\\*\\*/\\*.zip.",
10+
"loc.input.label.enableXmlTransform": "XML transformation",
11+
"loc.input.help.enableXmlTransform": "Config transforms will be run prior to the Variable Substitution.<br/>XML transformations are supported only for Windows platform.",
1012
"loc.input.label.xmlTransformationRules": "XML Transformation rules",
1113
"loc.input.help.xmlTransformationRules": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile> -xml <pathToSourceConfigurationFile>",
1214
"loc.input.label.jsonTargetFiles": "JSON target files",

_generated/FileTransformV2/filetransform.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ async function main() {
1010
tl.setResourcePath(path.join( __dirname, 'node_modules/azure-pipelines-tasks-webdeployment-common/module.json'));
1111
let webPackage = new Package(tl.getPathInput('folderPath', true));
1212
let packagePath = webPackage.getPath();
13-
let xmlTransformation = true;
13+
let xmlTransformation = tl.getBoolInput('enableXmlTransform', false);
1414
let xmlTransformationRules = tl.getDelimitedInput('xmlTransformationRules', '\n', false);
1515
let xmlTargetFiles = tl.getDelimitedInput('xmlTargetFiles', '\n', false);
1616
let jsonTargetFiles = tl.getDelimitedInput('jsonTargetFiles', '\n', false);
17-
if(xmlTransformationRules.length == 0) {
18-
xmlTransformation = false;
19-
}
2017

2118
if ( xmlTransformation || xmlTargetFiles.length != 0 || jsonTargetFiles.length != 0) {
2219
let isFolderBasedDeployment: boolean = tl.stats(packagePath).isDirectory();

0 commit comments

Comments
 (0)