From 9e4c39bd97bd976372470517cf8cb7d76fc9a655 Mon Sep 17 00:00:00 2001 From: Roraa Date: Fri, 20 Apr 2018 10:39:08 +0200 Subject: [PATCH 1/3] Added path parameter to the TfsTask --- src/GitVersionTfsTask/GitVersion.ts | 7 +- src/GitVersionTfsTask/task.json | 99 ++++++++++++++++------------- 2 files changed, 59 insertions(+), 47 deletions(-) diff --git a/src/GitVersionTfsTask/GitVersion.ts b/src/GitVersionTfsTask/GitVersion.ts index bd5b129df5..677195db21 100644 --- a/src/GitVersionTfsTask/GitVersion.ts +++ b/src/GitVersionTfsTask/GitVersion.ts @@ -8,11 +8,14 @@ var updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo'); var updateAssemblyInfoFilename = tl.getInput('updateAssemblyInfoFilename'); var additionalArguments = tl.getInput('additionalArguments'); var gitVersionPath = tl.getInput('gitVersionPath'); +var targetPath = tl.getInput('targetPath'); var preferBundledVersion = tl.getBoolInput('preferBundledVersion'); var currentDirectory = __dirname; -var sourcesDirectory = tl.getVariable("Build.SourcesDirectory") +var workingDirectory = !targetPath + ? tl.getVariable("Build.SourcesDirectory") + : path.join(tl.getVariable("Build.SourcesDirectory"), targetPath); if (!gitVersionPath) { gitVersionPath = tl.which("GitVersion.exe"); @@ -47,7 +50,7 @@ if (!gitVersionPath) { } toolRunner.arg([ - sourcesDirectory, + workingDirectory, "/output", "buildserver", "/nofetch" diff --git a/src/GitVersionTfsTask/task.json b/src/GitVersionTfsTask/task.json index 58f8c6b6b4..31a7ce71bb 100644 --- a/src/GitVersionTfsTask/task.json +++ b/src/GitVersionTfsTask/task.json @@ -21,51 +21,60 @@ } ], "instanceNameFormat": "GitVersion", - "inputs": [ - { - "name": "updateAssemblyInfo", - "type": "boolean", - "label": "Update AssemblyInfo files", - "defaultValue": "false", - "required": false, - "helpMarkDown": "Whether to update versions in the AssemblyInfo files" - }, - { - "name": "updateAssemblyInfoFilename", - "type": "string", - "label": "Update Assembly File", - "defaultValue": "", - "required": false, - "helpMarkDown": "Update versions in specified file", - "groupName": "additional" - }, - { - "name": "additionalArguments", - "type": "string", - "label": "Additional GitVersion.exe arguments", - "defaultValue": "", - "required": false, - "helpMarkDown": "Additional arguments to send to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "gitVersionPath", - "type": "string", - "label": "Path to GitVersion.exe", - "defaultValue": "", - "required": false, - "helpMarkDown": "Optionally supply the path to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "preferBundledVersion", - "type": "boolean", - "label": "Prefer bundled GiVersion.exe", - "required": false, - "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", - "groupName": "additional" - } - ], + "inputs": [ + { + "name": "updateAssemblyInfo", + "type": "boolean", + "label": "Update AssemblyInfo files", + "defaultValue": "false", + "required": false, + "helpMarkDown": "Whether to update versions in the AssemblyInfo files" + }, + { + "name": "updateAssemblyInfoFilename", + "type": "string", + "label": "Update Assembly File", + "defaultValue": "", + "required": false, + "helpMarkDown": "Update versions in specified file", + "groupName": "additional" + }, + { + "name": "additionalArguments", + "type": "string", + "label": "Additional GitVersion.exe arguments", + "defaultValue": "", + "required": false, + "helpMarkDown": "Additional arguments to send to GitVersion.exe", + "groupName": "additional" + }, + { + "name": "gitVersionPath", + "type": "string", + "label": "Path to GitVersion.exe", + "defaultValue": "", + "required": false, + "helpMarkDown": "Optionally supply the path to GitVersion.exe", + "groupName": "additional" + }, + { + "name": "targetPath", + "type": "string", + "label": "Working directory path", + "defaultValue": "", + "required": false, + "helpMarkDown": "Optionally supply the path to the working directory", + "groupName": "additional" + }, + { + "name": "preferBundledVersion", + "type": "boolean", + "label": "Prefer bundled GiVersion.exe", + "required": false, + "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", + "groupName": "additional" + } + ], "execution": { "Node": { "target": "GitVersion.js", From c94e22f1f2c2c8593554b1b6fe0fd5fb83c02d03 Mon Sep 17 00:00:00 2001 From: Roraa Date: Fri, 20 Apr 2018 10:43:04 +0200 Subject: [PATCH 2/3] Fixed incorrect spacing --- src/GitVersionTfsTask/task.json | 108 ++++++++++++++++---------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/src/GitVersionTfsTask/task.json b/src/GitVersionTfsTask/task.json index 31a7ce71bb..786acbe2c6 100644 --- a/src/GitVersionTfsTask/task.json +++ b/src/GitVersionTfsTask/task.json @@ -21,60 +21,60 @@ } ], "instanceNameFormat": "GitVersion", - "inputs": [ - { - "name": "updateAssemblyInfo", - "type": "boolean", - "label": "Update AssemblyInfo files", - "defaultValue": "false", - "required": false, - "helpMarkDown": "Whether to update versions in the AssemblyInfo files" - }, - { - "name": "updateAssemblyInfoFilename", - "type": "string", - "label": "Update Assembly File", - "defaultValue": "", - "required": false, - "helpMarkDown": "Update versions in specified file", - "groupName": "additional" - }, - { - "name": "additionalArguments", - "type": "string", - "label": "Additional GitVersion.exe arguments", - "defaultValue": "", - "required": false, - "helpMarkDown": "Additional arguments to send to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "gitVersionPath", - "type": "string", - "label": "Path to GitVersion.exe", - "defaultValue": "", - "required": false, - "helpMarkDown": "Optionally supply the path to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "targetPath", - "type": "string", - "label": "Working directory path", - "defaultValue": "", - "required": false, - "helpMarkDown": "Optionally supply the path to the working directory", - "groupName": "additional" - }, - { - "name": "preferBundledVersion", - "type": "boolean", - "label": "Prefer bundled GiVersion.exe", - "required": false, - "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", - "groupName": "additional" - } - ], + "inputs": [ + { + "name": "updateAssemblyInfo", + "type": "boolean", + "label": "Update AssemblyInfo files", + "defaultValue": "false", + "required": false, + "helpMarkDown": "Whether to update versions in the AssemblyInfo files" + }, + { + "name": "updateAssemblyInfoFilename", + "type": "string", + "label": "Update Assembly File", + "defaultValue": "", + "required": false, + "helpMarkDown": "Update versions in specified file", + "groupName": "additional" + }, + { + "name": "additionalArguments", + "type": "string", + "label": "Additional GitVersion.exe arguments", + "defaultValue": "", + "required": false, + "helpMarkDown": "Additional arguments to send to GitVersion.exe", + "groupName": "additional" + }, + { + "name": "gitVersionPath", + "type": "string", + "label": "Path to GitVersion.exe", + "defaultValue": "", + "required": false, + "helpMarkDown": "Optionally supply the path to GitVersion.exe", + "groupName": "additional" + }, + { + "name": "targetPath", + "type": "string", + "label": "Working directory path", + "defaultValue": "", + "required": false, + "helpMarkDown": "Optionally supply the path to the working directory", + "groupName": "additional" + }, + { + "name": "preferBundledVersion", + "type": "boolean", + "label": "Prefer bundled GiVersion.exe", + "required": false, + "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", + "groupName": "additional" + } + ], "execution": { "Node": { "target": "GitVersion.js", From 15cf11e44e6e4f0f0f8c019cd5afda5751a39761 Mon Sep 17 00:00:00 2001 From: Roraa Date: Fri, 20 Apr 2018 10:46:08 +0200 Subject: [PATCH 3/3] Fixed some more incorrect spacing --- src/GitVersionTfsTask/task.json | 104 ++++++++++++++++---------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/GitVersionTfsTask/task.json b/src/GitVersionTfsTask/task.json index 786acbe2c6..24262a07a1 100644 --- a/src/GitVersionTfsTask/task.json +++ b/src/GitVersionTfsTask/task.json @@ -22,58 +22,58 @@ ], "instanceNameFormat": "GitVersion", "inputs": [ - { - "name": "updateAssemblyInfo", - "type": "boolean", - "label": "Update AssemblyInfo files", - "defaultValue": "false", - "required": false, - "helpMarkDown": "Whether to update versions in the AssemblyInfo files" - }, - { - "name": "updateAssemblyInfoFilename", - "type": "string", - "label": "Update Assembly File", - "defaultValue": "", - "required": false, - "helpMarkDown": "Update versions in specified file", - "groupName": "additional" - }, - { - "name": "additionalArguments", - "type": "string", - "label": "Additional GitVersion.exe arguments", - "defaultValue": "", - "required": false, - "helpMarkDown": "Additional arguments to send to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "gitVersionPath", - "type": "string", - "label": "Path to GitVersion.exe", - "defaultValue": "", - "required": false, - "helpMarkDown": "Optionally supply the path to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "targetPath", - "type": "string", - "label": "Working directory path", - "defaultValue": "", - "required": false, - "helpMarkDown": "Optionally supply the path to the working directory", - "groupName": "additional" - }, - { - "name": "preferBundledVersion", - "type": "boolean", - "label": "Prefer bundled GiVersion.exe", - "required": false, - "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", - "groupName": "additional" - } + { + "name": "updateAssemblyInfo", + "type": "boolean", + "label": "Update AssemblyInfo files", + "defaultValue": "false", + "required": false, + "helpMarkDown": "Whether to update versions in the AssemblyInfo files" + }, + { + "name": "updateAssemblyInfoFilename", + "type": "string", + "label": "Update Assembly File", + "defaultValue": "", + "required": false, + "helpMarkDown": "Update versions in specified file", + "groupName": "additional" + }, + { + "name": "additionalArguments", + "type": "string", + "label": "Additional GitVersion.exe arguments", + "defaultValue": "", + "required": false, + "helpMarkDown": "Additional arguments to send to GitVersion.exe", + "groupName": "additional" + }, + { + "name": "gitVersionPath", + "type": "string", + "label": "Path to GitVersion.exe", + "defaultValue": "", + "required": false, + "helpMarkDown": "Optionally supply the path to GitVersion.exe", + "groupName": "additional" + }, + { + "name": "targetPath", + "type": "string", + "label": "Working directory path", + "defaultValue": "", + "required": false, + "helpMarkDown": "Optionally supply the path to the working directory", + "groupName": "additional" + }, + { + "name": "preferBundledVersion", + "type": "boolean", + "label": "Prefer bundled GiVersion.exe", + "required": false, + "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", + "groupName": "additional" + } ], "execution": { "Node": {