Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Grunt task to change version numbers #11335

Merged
merged 1 commit into from
Nov 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module.exports = function(grunt) {
"use strict";

RegExp.quote = require('regexp-quote')
var btoa = require('btoa')
// Project configuration.
grunt.initConfig({
Expand Down Expand Up @@ -156,6 +157,17 @@ module.exports = function(grunt) {
files: 'less/*.less',
tasks: ['recess']
}
},

sed: {
versionNumber: {
pattern: (function () {
var old = grunt.option('oldver')
return old ? RegExp.quote(old) : old
})(),
replacement: grunt.option('newver'),
recursive: true
}
}
});

Expand All @@ -173,6 +185,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-html-validation');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-sed');

// Docs HTML validation task
grunt.registerTask('validate-html', ['jekyll', 'validation']);
Expand Down Expand Up @@ -203,6 +216,11 @@ module.exports = function(grunt) {
// Default task.
grunt.registerTask('default', ['test', 'dist', 'build-customizer']);

// Version numbering task.
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
// This can be overzealous, so its changes should always be manually reviewed!
grunt.registerTask('change-version-number', ['sed']);

// task for building customizer
grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () {
var fs = require('fs')
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@
, "grunt-html-validation": "~0.1.6"
, "grunt-jekyll": "~0.4.0"
, "grunt-recess": "~0.4.0"
, "grunt-sed": "~0.1.1"
, "regexp-quote": "~0.0.0"
}
}