@@ -21,11 +21,21 @@ module.exports = function (grunt) {
21
21
grunt . registerTask ( 'test' , [ 'clean:coverage' , 'jshint' , 'karma' , 'coverage' ] ) ;
22
22
grunt . registerTask ( 'travis-test' , [ 'concat' , 'umd' , 'copy:setupFiles' , 'jshint' , 'karma' , 'coverage' , 'coveralls' ] ) ;
23
23
24
- grunt . registerTask ( 'release' , [ 'bump-only' , 'compile' , 'demo_pages' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
25
- grunt . registerTask ( 'release:patch' , [ 'bump-only:patch' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
26
- grunt . registerTask ( 'release:minor' , [ 'bump-only:minor' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
27
- grunt . registerTask ( 'release:major' , [ 'bump-only:major' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
28
- grunt . registerTask ( 'release:prerelease' , [ 'bump-only:prerelease' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
24
+ grunt . registerTask ( 'release' , [ 'bump-only' , 'setVersion' , 'compile' , 'demo_pages' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
25
+ grunt . registerTask ( 'release:patch' , [ 'bump-only:patch' , 'setVersion' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
26
+ grunt . registerTask ( 'release:minor' , [ 'bump-only:minor' , 'setVersion' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
27
+ grunt . registerTask ( 'release:major' , [ 'bump-only:major' , 'setVersion' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
28
+ grunt . registerTask ( 'release:prerelease' , [ 'bump-only:prerelease' , 'setVersion' , 'compile' , 'changelog' , 'gitcommit' , 'bump-commit' , 'shell:publish' ] ) ;
29
+
30
+ grunt . registerTask ( 'setVersion' , function ( ) {
31
+ var pkgJson = require ( './package.json' ) ;
32
+ var version = pkgJson . version ;
33
+ //grunt.log.writeln('textAngular version:'+version);
34
+ var contents = grunt . file . read ( './src/globals.js' ) ;
35
+ contents = contents . replace ( / t e x t A n g u l a r V e r s i o n = ' v \d + .\d + .\d + ' / i, "textAngularVersion = 'v" + version + "'" ) ;
36
+ grunt . file . write ( './src/globals.js' , contents ) ;
37
+ console . log ( 'Updated src/globals.js to textAngular version: v' + version ) ;
38
+ } ) ;
29
39
30
40
var testConfig = function ( configFile , customOptions ) {
31
41
var options = { configFile : configFile , keepalive : true } ;
0 commit comments