Ticket #2542: 2542.11.diff
File 2542.11.diff, 3.3 KB (added by , 11 years ago) |
---|
-
Gruntfile.js
5 5 BUILD_DIR = 'build/', 6 6 7 7 BBP_RTL_CSS = [ 8 'includes/admin/css/ *-rtl.css',9 'includes/admin/styles/* -rtl.css',10 'templates/default/css/ *-rtl.css'8 'includes/admin/css/admin-rtl.css', 9 'includes/admin/styles/*/colors-rtl.css', 10 'templates/default/css/bbpress-rtl.css' 11 11 ], 12 12 13 13 BBP_LTR_CSS = [ 14 'includes/admin/css/ *.css',15 'includes/admin/styles/* .css',16 'templates/default/css/ *.css'14 'includes/admin/css/admin.css', 15 'includes/admin/styles/*/colors.css', 16 'templates/default/css/bbpress.css' 17 17 ], 18 18 19 19 BBP_JS = [ … … 98 98 }, 99 99 cssmin: { 100 100 ltr: { 101 cwd: SOURCE_DIR,101 cwd: BUILD_DIR, 102 102 dest: BUILD_DIR, 103 103 expand: true, 104 104 ext: '.min.css', … … 112 112 ext: '.min.css', 113 113 src: BBP_RTL_CSS, 114 114 options: { banner: '/*! https://wordpress.org/plugins/bbpress/ */' } 115 },116 colors: {117 cwd: BUILD_DIR,118 dest: BUILD_DIR,119 expand: true,120 ext: '.min.css',121 src: [122 'includes/admin/styles/*/*.css'123 ]124 115 } 125 116 }, 126 117 cssjanus: { 127 118 core: { 128 119 expand: true, 129 cwd: SOURCE_DIR,120 cwd: BUILD_DIR, 130 121 dest: BUILD_DIR, 131 122 ext: '-rtl.css', 132 123 src: BBP_LTR_CSS, 133 124 options: { generateExactDuplicates: true } 134 125 }, 135 colors: { 136 options: { 137 processContent: function( src ) { 138 return src.replace( /([^/]+)\.css/gi, '$1-rtl.css' ); 139 } 140 }, 126 dynamic: { 141 127 expand: true, 142 128 cwd: BUILD_DIR, 143 129 dest: BUILD_DIR, 144 130 ext: '-rtl.css', 145 src: [146 'includes/admin/styles/*/colors.css'147 ]148 },149 dynamic: {150 expand: true,151 cwd: SOURCE_DIR,152 dest: BUILD_DIR,153 ext: '-rtl.css',154 131 src: [] 155 132 } 156 133 }, … … 293 270 } 294 271 }, 295 272 colors: { 296 files: [SOURCE_DIR + 'includes/admin/styles/* *'],297 tasks: ['sass:colors' ]273 files: [SOURCE_DIR + 'includes/admin/styles/*/colors.scss'], 274 tasks: ['sass:colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl'] 298 275 }, 299 276 rtl: { 300 277 files: BBP_LTR_CSS.map( function( path ) { 301 278 return SOURCE_DIR + path; 302 279 } ), 303 tasks: [ 'cssjanus:dynamic' ],280 tasks: [ 'cssjanus:dynamic', 'cssmin:ltr', 'cssmin:rtl' ], 304 281 options: { 305 282 interval: 2000, 306 283 spawn: false … … 315 292 grunt.registerTask('colors', ['sass:colors']); 316 293 317 294 // Build tasks. 318 grunt.registerTask( 'build', [ 'clean:all', 'copy:files', 'c ssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'colors', 'cssjanus:colors', 'cssmin:colors','uglify:core', 'jsvalidate:build', 'pot' ] );319 grunt.registerTask( 'build-release', [ 'clean:all', 'copy:files', 'c ssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'colors', 'cssjanus:colors', 'cssmin:colors','uglify:core', 'jsvalidate:build', 'checktextdomain', 'pot', 'phpunit' ] );295 grunt.registerTask( 'build', [ 'clean:all', 'copy:files', 'colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'uglify:core', 'jsvalidate:build', 'pot' ] ); 296 grunt.registerTask( 'build-release', [ 'clean:all', 'copy:files', 'colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'uglify:core', 'jsvalidate:build', 'checktextdomain', 'pot', 'phpunit' ] ); 320 297 321 298 // Testing tasks. 322 299 grunt.registerMultiTask( 'phpunit', 'Runs PHPUnit tests, including the ajax and multisite tests.', function() {