Switch to Gulp Task Runner
This commit is contained in:
parent
a7e8c3a1af
commit
a49c22958a
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
@ -8,8 +8,7 @@
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceRoot}"
|
||||
],
|
||||
"preLaunchTask": "tsc"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
32
.vscode/tasks.json
vendored
32
.vscode/tasks.json
vendored
@ -1,15 +1,21 @@
|
||||
// Available variables which can be used inside of strings.
|
||||
// ${workspaceRoot}: the root folder of the team
|
||||
// ${file}: the current opened file
|
||||
// ${fileBasename}: the current opened file's basename
|
||||
// ${fileDirname}: the current opened file's dirname
|
||||
// ${fileExtname}: the current opened file's extension
|
||||
// ${cwd}: the current working directory of the spawned process
|
||||
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"command": "tsc",
|
||||
"isShellCommand": true,
|
||||
"showOutput": "silent",
|
||||
"problemMatcher": "$tsc-watch"
|
||||
"version": "0.1.0",
|
||||
"command": "gulp",
|
||||
"isShellCommand": true,
|
||||
"args": [
|
||||
"--no-color"
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"taskName": "build",
|
||||
"args": [],
|
||||
"isBuildCommand": true,
|
||||
"isWatching": false,
|
||||
"problemMatcher": [
|
||||
"$lessCompile",
|
||||
"$tsc",
|
||||
"$jshint"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
9
gulpfile.js
Normal file
9
gulpfile.js
Normal file
@ -0,0 +1,9 @@
|
||||
var gulp = require('gulp');
|
||||
|
||||
var shell = require('gulp-shell');
|
||||
|
||||
gulp.task('compile-typescript', function () {
|
||||
gulp.src('package.json').pipe(shell('tsc'));
|
||||
});
|
||||
|
||||
gulp.task('build', ['compile-typescript']);
|
@ -113,7 +113,9 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"vscode": "^0.10.7",
|
||||
"typescript": "^1.6.2"
|
||||
"typescript": "^1.6.2",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-shell": "^0.5.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"xmldom": "DotJoshJohnson/xmldom#2794915",
|
||||
|
@ -1,23 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
let child_process = require('child_process');
|
||||
|
||||
export class ChildProcess {
|
||||
static async spawnAsync(executable: string, args: string[]): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
|
||||
let handle = child_process.spawn(executable, args);
|
||||
|
||||
handle.on('close', (code: string) => {
|
||||
if (code == '0') {
|
||||
resolve();
|
||||
}
|
||||
|
||||
else {
|
||||
reject(code);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
'use strict';
|
||||
|
||||
let child_process = require('child_process');
|
||||
|
||||
export class ChildProcess {
|
||||
static async spawnAsync(executable: string, args: string[]): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
|
||||
let handle = child_process.spawn(executable, args);
|
||||
|
||||
handle.on('close', (code: string) => {
|
||||
if (code == '0') {
|
||||
resolve();
|
||||
}
|
||||
|
||||
else {
|
||||
reject(code);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
@ -1,23 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
import * as xpath from 'xpath';
|
||||
|
||||
let DOMParser = require('xmldom').DOMParser;
|
||||
|
||||
export class XPathEvaluator {
|
||||
static evaluate(query: string, xml: string): Node[] {
|
||||
let nodes: Node[] = new Array<Node>();
|
||||
|
||||
let xdoc: Document = new DOMParser().parseFromString(xml, 'text/xml');
|
||||
let resolver: xpath.XPathNSResolver = xpath.createNSResolver(xdoc);
|
||||
let expression: xpath.XPathExpression = xpath.createExpression(query, resolver);
|
||||
let result: xpath.XPathResult = expression.evaluate(xdoc, xpath.XPathResult.ORDERED_NODE_ITERATOR_TYPE);
|
||||
|
||||
let node: Node;
|
||||
while (node = result.iterateNext()) {
|
||||
nodes.push(node);
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
'use strict';
|
||||
|
||||
import * as xpath from 'xpath';
|
||||
|
||||
let DOMParser = require('xmldom').DOMParser;
|
||||
|
||||
export class XPathEvaluator {
|
||||
static evaluate(query: string, xml: string): Node[] {
|
||||
let nodes: Node[] = new Array<Node>();
|
||||
|
||||
let xdoc: Document = new DOMParser().parseFromString(xml, 'text/xml');
|
||||
let resolver: xpath.XPathNSResolver = xpath.createNSResolver(xdoc);
|
||||
let expression: xpath.XPathExpression = xpath.createExpression(query, resolver);
|
||||
let result: xpath.XPathResult = expression.evaluate(xdoc, xpath.XPathResult.ORDERED_NODE_ITERATOR_TYPE);
|
||||
|
||||
let node: Node;
|
||||
while (node = result.iterateNext()) {
|
||||
nodes.push(node);
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user