-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jakefile.js
45 lines (36 loc) · 1.2 KB
/
Jakefile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Leaflet plugin building script.
*
* To use, install Node.js, then run the following commands in the project root:
*
* npm install -g jake (you might need admin rights - sudo)
* npm install
*/
var build = require("./build/build.js"),
git = require('git-rev');
// Returns the version string in package.json, plus a semver build metadata if
// this is not an official release
function calculateVersion(officialRelease, callback) {
var packageJsonData = require('./package.json'),
version = packageJsonData.version;
if (officialRelease) {
callback(packageJsonData);
} else {
git.short(function(str) {
packageJsonData.version = version + '+' + str;
callback (packageJsonData);
});
}
}
desc("Combine and minify source files");
task('build', {async: true}, function (compsBase32, buildName, officialRelease) {
calculateVersion(officialRelease, function(metaData){
build.build(complete, metaData, compsBase32, buildName);
});
});
desc('Generate docs');
task('buildDocs', {async: true}, function () {
var packageJsonData = require('./package.json');
build.buildDocs(complete, packageJsonData);
});
task("default", ["build"]);