lib/leaflet/Jakefile.js in leaflet-js-0.6.beta4 vs lib/leaflet/Jakefile.js in leaflet-js-0.7.0

- old
+ new

@@ -12,15 +12,35 @@ For a custom build, open build/build.html in the browser and follow the instructions. */ var build = require('./build/build.js'); +function hint(msg, paths) { + return function () { + console.log(msg); + jake.exec('node node_modules/jshint/bin/jshint -c ' + paths, + {printStdout: true}, function () { + console.log('\tCheck passed.\n'); + complete(); + }); + } +} + desc('Check Leaflet source for errors with JSHint'); -task('lint', build.lint); +task('lint', {async: true}, hint('Checking for JS errors...', 'build/hintrc.js src')); +desc('Check Leaflet specs source for errors with JSHint'); +task('lintspec', {async: true}, hint('Checking for specs JS errors...', 'spec/spec.hintrc.js spec/suites')); + desc('Combine and compress Leaflet source files'); -task('build', ['lint'], build.build); +task('build', build.build); desc('Run PhantomJS tests'); -task('test', ['lint'], build.test); +task('test', ['lint', 'lintspec'], {async: true}, function () { + build.test(complete); +}); -task('default', ['build']); +task('default', ['test', 'build']); + +jake.addListener('complete', function () { + process.exit(); +});