mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
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:
parent
29a12d6ee5
commit
9bd950b6d1
26
Gruntfile.js
26
Gruntfile.js
@ -26,13 +26,17 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
copy: {
|
copy: {
|
||||||
all: {
|
files: {
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
dot: true,
|
dot: true,
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: SOURCE_DIR,
|
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
|
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: {
|
dynamic: {
|
||||||
dot: true,
|
dot: true,
|
||||||
expand: true,
|
expand: true,
|
||||||
@ -158,6 +175,11 @@ module.exports = function(grunt) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Register tasks.
|
// 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',
|
grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'uglify:core',
|
||||||
'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
|
'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user