Permalink
Browse files

Add current revision back to build output.

  • Loading branch information...
1 parent 4a972e6 commit 8aa0c0e036f6a80f5c61b1e22746c05f3b558efe @rwjblue rwjblue committed Jan 29, 2014
Showing with 14 additions and 2 deletions.
  1. +1 −0 Gruntfile.js
  2. +1 −1 generators/license.js
  3. +1 −1 packages/ember-data/lib/core.js
  4. +11 −0 tasks/setVersionStamp.js
View
@@ -14,6 +14,7 @@ module.exports = function(grunt){
grunt.initConfig(config);
grunt.registerTask('buildPackages', [
+ 'setVersionStamp',
'clean',
'transpile:amd',
'concat:globals',
View
@@ -3,5 +3,5 @@
* @copyright Copyright 2011-2014 Tilde Inc. and contributors.
* Portions Copyright 2011 LivingSocial Inc.
* @license Licensed under MIT license (see license.js)
- * @version <%= pkg.version %>
+ * @version <%= versionStamp %>
*/
@@ -13,7 +13,7 @@ if ('undefined' === typeof DS) {
/**
@property VERSION
@type String
- @default '<%= pkg.version %>'
+ @default '<%= versionStamp %>'
@static
*/
DS = Ember.Namespace.create({
View
@@ -0,0 +1,11 @@
+module.exports = function(grunt) {
+ grunt.registerTask('setVersionStamp', 'Add the currentRevision and versionStamp values to the global grunt config', function() {
+ var done = this.async();
+
+ grunt.util.spawn({cmd: 'git', args: ['rev-list', 'HEAD', '-n', '1']}, function(error, result, code){
+ grunt.config('currentRevision', result.toString());
+ grunt.config('versionStamp', grunt.config('pkg.version') + '.' + grunt.config('currentRevision').substr(0,8));
+ done();
+ })
+ });
+};

0 comments on commit 8aa0c0e

Please sign in to comment.