include version info in top comment, close #2276
This commit is contained in:
parent
abdf0c2afa
commit
9ae1623910
12
Jakefile.js
12
Jakefile.js
@ -12,7 +12,8 @@ To run the tests, run "jake test".
|
|||||||
For a custom build, open build/build.html in the browser and follow the instructions.
|
For a custom build, open build/build.html in the browser and follow the instructions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var build = require('./build/build.js');
|
var build = require('./build/build.js'),
|
||||||
|
version = require('./src/Leaflet.js').version;
|
||||||
|
|
||||||
function hint(msg, paths) {
|
function hint(msg, paths) {
|
||||||
return function () {
|
return function () {
|
||||||
@ -33,7 +34,14 @@ task('lintspec', {async: true}, hint('Checking for specs JS errors...', 'spec/sp
|
|||||||
|
|
||||||
desc('Combine and compress Leaflet source files');
|
desc('Combine and compress Leaflet source files');
|
||||||
task('build', {async: true}, function (compsBase32, buildName) {
|
task('build', {async: true}, function (compsBase32, buildName) {
|
||||||
build.build(complete, compsBase32, buildName);
|
var v;
|
||||||
|
|
||||||
|
jake.exec('git log -1 --pretty=format:"%h"', {}, function () {
|
||||||
|
build.build(complete, v, compsBase32, buildName);
|
||||||
|
|
||||||
|
}).on('stdout', function (data) {
|
||||||
|
v = version + ' (' + data.toString() + ')';
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
desc('Run PhantomJS tests');
|
desc('Run PhantomJS tests');
|
||||||
|
@ -82,13 +82,13 @@ function bytesToKB(bytes) {
|
|||||||
return (bytes / 1024).toFixed(2) + ' KB';
|
return (bytes / 1024).toFixed(2) + ' KB';
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.build = function (callback, compsBase32, buildName) {
|
exports.build = function (callback, version, compsBase32, buildName) {
|
||||||
|
|
||||||
var files = getFiles(compsBase32);
|
var files = getFiles(compsBase32);
|
||||||
|
|
||||||
console.log('Concatenating and compressing ' + files.length + ' files...');
|
console.log('Concatenating and compressing ' + files.length + ' files...');
|
||||||
|
|
||||||
var copy = fs.readFileSync('src/copyright.js', 'utf8'),
|
var copy = fs.readFileSync('src/copyright.js', 'utf8').replace('{VERSION}', version),
|
||||||
intro = '(function (window, document, undefined) {',
|
intro = '(function (window, document, undefined) {',
|
||||||
outro = '}(window, document));',
|
outro = '}(window, document));',
|
||||||
newSrc = copy + intro + combineFiles(files) + outro,
|
newSrc = copy + intro + combineFiles(files) + outro,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com
|
Leaflet {VERSION}, a JS library for interactive maps. http://leafletjs.com
|
||||||
(c) 2010-2013, Vladimir Agafonkin
|
(c) 2010-2013 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||||
(c) 2010-2011, CloudMade
|
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user