Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/GitVersionTfsTask/GitVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ export class GitVersionTask {
const updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo');
const updateAssemblyInfoFilename = tl.getInput('updateAssemblyInfoFilename');
const additionalArguments = tl.getInput('additionalArguments');
const targetPath = tl.getInput('targetPath');
const preferBundledVersion = tl.getBoolInput('preferBundledVersion');

const currentDirectory = __dirname;
const sourcesDirectory = tl.getVariable("Build.SourcesDirectory") || ".";
const workingDirectory = !targetPath
? tl.getVariable("Build.SourcesDirectory")
: path.join(tl.getVariable("Build.SourcesDirectory"), targetPath);

let gitVersionPath = tl.getInput('gitVersionPath');
if (!gitVersionPath) {
Expand Down Expand Up @@ -69,7 +72,7 @@ export class GitVersionTask {
}

toolRunner.arg([
sourcesDirectory,
workingDirectory,
"/output",
"buildserver",
"/nofetch"]);
Expand Down
9 changes: 9 additions & 0 deletions src/GitVersionTfsTask/GitVersionTask/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
"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",
Expand Down