-
Notifications
You must be signed in to change notification settings - Fork 655
Node execution engine and build tooling #1139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bee04ed
2007cbc
f50e855
4119c28
d4cdd08
c980b5c
62c1509
9df814a
6aa9896
0357739
a35d3bd
f12046c
d6ece81
ad64e71
1e78176
491494c
b2190f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"environments": [ | ||
{ | ||
"Name": "production", | ||
"VssExtensionIdSuffix": "", | ||
"VssExtensionGalleryFlags": [ | ||
"Public" | ||
], | ||
"DisplayNamesSuffix": "", | ||
"TaskIds": { | ||
"GitVersion" : "e5983830-3f75-11e5-82ed-81492570a08e" | ||
} | ||
}, | ||
{ | ||
"Name": "dev", | ||
"VssExtensionIdSuffix": "-dev", | ||
"VssExtensionGalleryFlags": [], | ||
"DisplayNamesSuffix": " (Development)", | ||
"TaskIds": { | ||
"GitVersion" : "f402bc4f-87b9-402a-a018-33aa296c2681" | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"manifestVersion": 1, | ||
"id": "gitversion", | ||
"id": "gl-gitversion", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert this change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll revert it when it's ready, meanwhile it allows me to publish a prerelease version of it without any conflicts :) |
||
"name": "GitVersion", | ||
"publisher": "gittools", | ||
"public": true, | ||
"publisher": "geeklearningio", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this one |
||
"author": "GitVersion Contributors", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our tooling allows you to build different version of the same extension. In order to do that we use the extension flags instead and they are configured in |
||
"version": "$version$", | ||
"description": "Build task for easy semantic versioning for projects using Git.", | ||
|
@@ -14,7 +13,7 @@ | |
], | ||
"files": [ | ||
{ | ||
"path": "GitVersionTask" | ||
"path": "Tasks" | ||
} | ||
], | ||
"categories": [ | ||
|
@@ -46,27 +45,15 @@ | |
}, | ||
"screenshots": [ | ||
{ | ||
"path": "img/builds.png" | ||
"path": "builds.png" | ||
}, | ||
{ | ||
"path": "img/build-task.png" | ||
"path": "build-task.png" | ||
} | ||
], | ||
"content": { | ||
"details": { | ||
"path": "overview.md" | ||
} | ||
}, | ||
"contributions": [ | ||
{ | ||
"id": "gitversion-task", | ||
"type": "ms.vss-distributed-task.task", | ||
"targets": [ | ||
"ms.vss-distributed-task.tasks" | ||
], | ||
"properties": { | ||
"name": "GitVersionTask" | ||
} | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import tl = require('vsts-task-lib/task'); | ||
import { IExecOptions, ToolRunner } from 'vsts-task-lib/toolrunner'; | ||
import path = require('path'); | ||
import q = require('q'); | ||
import os = require('os'); | ||
|
||
var updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo'); | ||
var updateAssemblyInfoFilename = tl.getInput('updateAssemblyInfoFilename'); | ||
var additionalArguments = tl.getInput('additionalArguments'); | ||
var gitVersionPath = tl.getInput('gitVersionPath'); | ||
var preferBundledVersion = tl.getBoolInput('preferBundledVersion'); | ||
|
||
var currentDirectory = __dirname; | ||
|
||
var sourcesDirectory = tl.getVariable("Build.SourcesDirectory") | ||
|
||
if (!gitVersionPath) { | ||
gitVersionPath = tl.which("GitVersion.exe"); | ||
if (preferBundledVersion || !gitVersionPath) { | ||
gitVersionPath = path.join(currentDirectory, "GitVersion.exe"); | ||
} | ||
} | ||
|
||
(async function execute() { | ||
try { | ||
|
||
var execOptions: IExecOptions = { | ||
cwd: undefined, | ||
env: undefined, | ||
silent: undefined, | ||
failOnStdErr: undefined, | ||
ignoreReturnCode: undefined, | ||
errStream: undefined, | ||
outStream: undefined | ||
}; | ||
|
||
var toolRunner: ToolRunner; | ||
|
||
var isWin32 = os.platform() == "win32"; | ||
|
||
if (isWin32) { | ||
toolRunner = tl.tool(gitVersionPath); | ||
} else { | ||
toolRunner = tl.tool("mono"); | ||
toolRunner.arg(gitVersionPath); | ||
} | ||
|
||
toolRunner.arg([ | ||
sourcesDirectory, | ||
"/output", | ||
"buildserver", | ||
"/nofetch" | ||
]); | ||
|
||
if (updateAssemblyInfo) { | ||
toolRunner.arg("/updateassemblyinfo") | ||
if (updateAssemblyInfoFilename) { | ||
toolRunner.arg(updateAssemblyInfoFilename); | ||
} else { | ||
toolRunner.arg("true"); | ||
} | ||
} | ||
|
||
if (additionalArguments) { | ||
toolRunner.line(additionalArguments); | ||
} | ||
|
||
var result = await toolRunner.exec(execOptions); | ||
if (result) { | ||
tl.setResult(tl.TaskResult.Failed, "An error occured during GitVersion execution") | ||
} else { | ||
tl.setResult(tl.TaskResult.Succeeded, "GitVersion executed successfully") | ||
} | ||
} | ||
catch (err) { | ||
tl.debug(err.stack) | ||
tl.setResult(tl.TaskResult.Failed, err); | ||
} | ||
})(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "gitversion", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"vsts-task-lib": "0.9.20", | ||
"q" : "1.4.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not native promises? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vsts-task-lib depends on q. I guess this is related to the fact that some agents are running older versions of node which won't provide native Promises. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "git-version-tfs-task", | ||
"version": "1.0.0", | ||
"description": "", | ||
"private": true, | ||
"main": "index.js", | ||
"author": "", | ||
"license": "MIT", | ||
"scripts": { | ||
"clean": "vsts-build-tools-clean", | ||
"postinstall": "vsts-build-tools-install", | ||
"prebuild": "vsts-build-tools-prebuild", | ||
"build": "tsc", | ||
"package": "vsts-build-tools-package" | ||
}, | ||
"devDependencies": { | ||
"@types/minimatch": "^2.0.29", | ||
"@types/node": "^7.0.5", | ||
"@types/q": "0.0.32", | ||
"async": "^2.0.1", | ||
"gl-vsts-tasks-build-scripts": "0.2.0-alpha.5", | ||
"npm-run-all": "2.3.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"removeComments": true, | ||
"preserveConstEnums": true, | ||
"target": "es6", | ||
"sourceMap": false, | ||
"inlineSourceMap": true, | ||
"declaration": true | ||
}, | ||
"filesGlob": [ | ||
"./Tasks/*.ts", | ||
"./Tests/*.ts", | ||
"./typings/index.d.ts", | ||
"./Common/Node/*.d.ts" | ||
], | ||
"exclude":[ | ||
"node_modules", | ||
"Tasks/GitVersion/node_modules", | ||
"Common", | ||
".BuildOutput" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a requirement, I would prefer
prerelease
or something?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can change it or remove it.