New grunt copy:version task that removes -src from $wp_version on build.

props azaozz.
fixes #25161.


git-svn-id: https://develop.svn.wordpress.org/trunk@25693 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-10-06 10:33:01 +00:00
parent 29a12d6ee5
commit 9bd950b6d1
1 changed files with 24 additions and 2 deletions

View File

@ -26,13 +26,17 @@ module.exports = function(grunt) {
}
},
copy: {
all: {
files: {
files: [
{
dot: true,
expand: true,
cwd: SOURCE_DIR,
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
src: [
'**',
'!**/.{svn,git}/**', // Ignore version control directories.
'!wp-includes/version.php' // Exclude version.php
],
dest: BUILD_DIR
},
{
@ -41,6 +45,19 @@ module.exports = function(grunt) {
}
]
},
version: {
options: {
processContent: function( src, filepath ) {
return src.replace( /^(\$wp_version.+?)-src';/m, "$1';" );
}
},
files: [
{
src: SOURCE_DIR + 'wp-includes/version.php',
dest: BUILD_DIR + 'wp-includes/version.php'
}
]
},
dynamic: {
dot: true,
expand: true,
@ -158,6 +175,11 @@ module.exports = function(grunt) {
});
// Register tasks.
// Copy task.
grunt.registerTask('copy:all', ['copy:files', 'copy:version']);
// Build task.
grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'uglify:core',
'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);