GH-4814 Looking at Gulp/Jake/Grunt plugins extensions. #4926
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4814
It is possible to have tasks with the same type, so we need to
differentiate them.
Using the handle available with the task to create a unique provider.
This allow to have following plugins within the same workspace:
Jake is using the old API to computeTask(). Because of that, I need to implement the deprecated Task constructor to handle Jake.
To support the vscode built-in plugin for JAKE , there is two ways:
1- I need to implement the deprecated Task constructor to handle Jake.
2- Jake vscode built-in plugin needs to be adjusted to handle the creation of task using the newest API
In the current solution, I implemented solution 1, so we can support JAKE until vscode modify the Jake plugin
For solution 2, we need to modify:
File: jake/src/main.ts
Method computeTasks() at ~line 145, need to modify the following line by adding the workspaceFolder as a parameter:
OLD:
let task = new vscode.Task(kind, taskName, 'jake', new vscode.ShellExecution(
${jakeCommand} ${taskName}
, options));NEW:
let task = new vscode.Task(kind, this._workspaceFolder, taskName, 'jake', new vscode.ShellExecution(
${jakeCommand} ${taskName}
, options));For testing purpose, you need to add in the package.json the following packages. (Either in devDependencies or dependencies)
"dependencies": {
"gulp": "latest",
"gulp-util": "latest",
"gulp-sass": "latest",
"gulp-coffee": "latest",
"gulp-uglify": "latest",
"gulp-concat": "latest",
"gulp-connect": "latest",
"grunt": "~0.4.5",
"grunt-cli": "^1.3.2",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "~0.5.3",
"jake": "^8.1.1"
}
With those packages installed, you can test "Gulp", Grunt", "Jake" and "npm" if installed
Signed-off-by: Jacques Bouthillier jacques.bouthillier@ericsson.com