Change Gruntfile to auto-build before running tests
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/45baa2cc Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/45baa2cc Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/45baa2cc Branch: refs/heads/master Commit: 45baa2cce0c9aa682f77f09a35917f6cd7622720 Parents: 2ec92f7 Author: Andrew Grieve <[email protected]> Authored: Mon Jul 29 15:23:50 2013 -0400 Committer: Andrew Grieve <[email protected]> Committed: Mon Jul 29 15:23:50 2013 -0400 ---------------------------------------------------------------------- Gruntfile.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/45baa2cc/Gruntfile.js ---------------------------------------------------------------------- diff --git a/Gruntfile.js b/Gruntfile.js index 81275ad..83f2b7d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -118,17 +118,17 @@ module.exports = function(grunt) { packager.generate(platformName, useWindowsLineEndings, done); }); - grunt.registerTask('test', 'Runs test in node', function() { + grunt.registerTask('_test', 'Runs test in node', function() { var done = this.async(); require('./test/runner').node(done); }); - grunt.registerTask('btest', 'Runs tests in the browser', function() { + grunt.registerTask('_btest', 'Runs tests in the browser', function() { require('./test/runner').browser(); this.async(); // never finish. }); - grunt.registerTask('complainwhitespace', 'Complain about what fixwhitespace would fix', function() { + grunt.registerTask('_complainwhitespace', 'Complain about what fixwhitespace would fix', function() { var done = this.async(); var complainedAboutWhitespace = false; processWhiteSpace(function(file, newSource) { @@ -140,7 +140,7 @@ module.exports = function(grunt) { }, done); }); - grunt.registerTask('fixwhitespace', 'Converts tabs to four spaces, eliminates trailing white space, converts newlines to proper form - enforcing style guide ftw!', function() { + grunt.registerTask('_fixwhitespace', 'Converts tabs to four spaces, eliminates trailing white space, converts newlines to proper form - enforcing style guide ftw!', function() { var done = this.async(); var complainedAboutWhitespace = false; processWhiteSpace(function(file, newSource) { @@ -154,7 +154,7 @@ module.exports = function(grunt) { }); // TODO - Delete this task and use Grunt's built-in jshint (CB-3964). - grunt.registerTask('hint', 'Runs jshint.', function() { + grunt.registerTask('_hint', 'Runs jshint.', function() { var done = this.async(); var knownWarnings = [ "Redefinition of 'FileReader'", @@ -182,5 +182,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-jshint'); // Default task(s). - grunt.registerTask('default', ['cordovajs', 'hint', 'complainwhitespace', 'test']); + grunt.registerTask('build', ['cordovajs', '_hint', '_complainwhitespace']); + grunt.registerTask('default', ['build', '_test']); + grunt.registerTask('test', ['build', '_test']); + grunt.registerTask('btest', ['build', '_btest']); };
