-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
suggestion: all detected tasks should be generated in the task.json #4219
Comments
We should inform the user about the result of the auto detection in particular when auto detection isn't successful. |
@egamma I have an issue about letting the user know the outcome of the auto detection. I will move this to you since you 'own' the grunt detection :-) to look into why it fails. |
Auto detection detects Verified that the grungtfile below, detects the {
// See http://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "grunt",
"isShellCommand": true,
"tasks": [
{
"taskName": "test",
"args": [],
"isTestCommand": true
}
]
} gruntfile.js module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['src/**/*.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
qunit: {
files: ['test/**/*.html']
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'qunit']
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('test', ['jshint', 'qunit']);
grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']);
}; |
OK, but it is not obvious that we do this and in many cases it looks like a bug. If i have a grunt/gulp file and do "task " from the command palette i see all of the tasks found in the file. As a user, my expectation is that we scaffold out a wrapper for each of those tasks. So, i'm reopening this but moving it to the backlog. |
@chrisdias The Tasks integration understands grunt, gulp, jake tasks and therefore doesn't need a scaffolding for each task. What the task integration cannot know is 1) which of these tasks is the |
yes, understood, but perhaps I would like to customize each of the tasks. Having them scaffolded in tasks.json should not change any behavior but it lets me see the connection between the full list of tasks we detect and how tasks.json can be used to augment each task. |
I am closing this. In task 2.0.0 you can now configure individual tasks using a menu entry and we add the necessary scaffold to the tasks.json. With contributable task providers we can't generate scaffolds for all tasks anyways. |
testing #4019
i created this gruntfile (based on http://gruntjs.com/getting-started), selected grunt from the list, and it didnt scaffold out any tasks. not sure what the expected behavior is, but the message in the list says that tasks will be auto detected.
and here is the tasks.json created
The text was updated successfully, but these errors were encountered: