diff --git a/build/Gruntfile.js b/build/Gruntfile.js index a21240cd6..b3ef700c0 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -1,9 +1,7 @@ module.exports = function(grunt) { var _ = require('lodash'), defaultConfig, - packageFile, - revisionHash = '@@REVISION', - revisionTimeStamp = '@@REVISIONDATE'; + packageFile; grunt.loadNpmTasks('grunt-contrib-clean'); @@ -55,43 +53,6 @@ module.exports = function(grunt) { }); } - grunt.registerTask('init-config', 'Initialize build script', function() { - var exec = require('child_process').exec, - done = this.async(), - commandsRef = 0; - - function doneTask() { - if (--commandsRef <= 0) { - done(true); - } - } - - function doCommand(command, callback) { - commandsRef++; - exec(command, callback); - } - - doCommand('hg log -r -1 --template "{node|short}"', function(error, stdout, stderr) { - if (error) { - grunt.log.writeln('Error: ' + error); - } else { - revisionHash = stdout; - } - - doneTask(); - }); - - doCommand('hg log -r -1 --template "{date|isodate}"', function(error, stdout, stderr) { - if (error) { - grunt.log.writeln('Error: ' + error); - } else { - revisionTimeStamp = stdout; - } - - doneTask(); - }); - }); - grunt.initConfig({ mocha: { test: { @@ -212,7 +173,7 @@ module.exports = function(grunt) { ' *\n' + ' * <%= pkg.homepage %> \n' + ' *\n' + - ' * Version: <%= pkg.version %> (build:<%= pkg.build %>, rev:' + revisionHash + ', date:' + revisionTimeStamp + ')\n' + + ' * Version: <%= pkg.version %> (build:<%= pkg.build %>, rev:' + (process.env['GIT_COMMIT'] || 'local') + ')\n' + ' */\n' }, dist: { @@ -444,9 +405,9 @@ module.exports = function(grunt) { } }); - grunt.registerTask('deploy-documenteditor', ['init-build-documenteditor', 'init-config', 'deploy-app']); - grunt.registerTask('deploy-spreadsheeteditor', ['init-build-spreadsheeteditor', 'init-config', 'deploy-app']); - grunt.registerTask('deploy-presentationeditor', ['init-build-presentationeditor', 'init-config', 'deploy-app']); + grunt.registerTask('deploy-documenteditor', ['init-build-documenteditor', 'deploy-app']); + grunt.registerTask('deploy-spreadsheeteditor', ['init-build-spreadsheeteditor', 'deploy-app']); + grunt.registerTask('deploy-presentationeditor', ['init-build-presentationeditor', 'deploy-app']); grunt.registerTask('default', ['deploy-documenteditor', 'deploy-spreadsheeteditor', 'deploy-presentationeditor']); }; \ No newline at end of file diff --git a/build/package.json b/build/package.json index 5c5a63df3..003fbbd8d 100644 --- a/build/package.json +++ b/build/package.json @@ -6,7 +6,6 @@ "dependencies": { "lodash": "^4.0.0", "grunt": "0.4.5", - "grunt-exec": "0.4.5", "grunt-replace": "0.7.3", "grunt-html-minify": "0.3.1", "grunt-text-replace": "0.3.11",