arnaucube
arnaucube/commonroutesAppPublic Self-hosted repository
commonroutesApp/www/lib/leaflet/Jakefile.js
www/lib/leaflet/Jakefile.jsRaw
 1/*
 2Leaflet building, testing and linting scripts.
 3
 4To use, install Node, then run the following commands in the project root:
 5
 6    npm install -g jake
 7    npm install
 8
 9To check the code for errors and build Leaflet from source, run "jake".
10To run the tests, run "jake test".
11
12For a custom build, open build/build.html in the browser and follow the instructions.
13*/
14
15var build = require('./build/build.js');
16
17function hint(msg, paths) {
18	return function () {
19		console.log(msg);
20		jake.exec('node node_modules/jshint/bin/jshint -c ' + paths,
21				{printStdout: true}, function () {
22			console.log('\tCheck passed.\n');
23			complete();
24		});
25	}
26}
27
28desc('Check Leaflet source for errors with JSHint');
29task('lint', {async: true}, hint('Checking for JS errors...', 'build/hintrc.js src'));
30
31desc('Check Leaflet specs source for errors with JSHint');
32task('lintspec', {async: true}, hint('Checking for specs JS errors...', 'spec/spec.hintrc.js spec/suites'));
33
34desc('Combine and compress Leaflet source files');
35task('build', {async: true}, function () {
36	build.build(complete);
37});
38
39desc('Run PhantomJS tests');
40task('test', ['lint', 'lintspec'], {async: true}, function () {
41	build.test(complete);
42});
43
44task('default', ['test', 'build']);
45
46jake.addListener('complete', function () {
47  process.exit();
48});