Skip to:
Content

bbPress.org

Changeset 5294


Ignore:
Timestamp:
02/25/2014 05:13:30 AM (8 years ago)
Author:
netweb
Message:

More Grunt updates, fixes grunt watch task not RTL'ing or minifying CSS files.

  • Use explicit CSS file names, avoids ambiguous LTR CSS (avoids LTR = *.css including bbpress-rtl.css)
  • Remove cssmin:colors and include Mint and Evergreen CSS minification in cssmin:core
  • Remove cssjanus:colors and include Mint and Evergreen RTL CSS in cssjanus:core
  • Use BUILD_DIR (not SOURCE_DIR) to compile RTL CSS cssjanus
  • Use BUILD_DIR (not SOURCE_DIR) to compile and LTR & RTL minified CSS with cssmin
  • Add Grunt tasks cssjanus:core, cssmin:ltr and cssmin:rtl to grunt watch -> watch:colors task
  • Add Grunt tasks cssmin:ltr and cssmin:rtl to grunt watch -> watch:rtl task
  • Reorders grunt build and grunt build-release tasks to firstly copy bbpress.css, and admin.css, then create Mint and Evergreen CSS using colors , then RTL all the CSS with cssjanus:core, then minify all the CSS with cssmin:ltr and cssmin:rtl
  • Props netweb. See #2542
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r5293 r5294  
    66
    77    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'
    1111    ],
    1212
    1313    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'
    1717    ],
    1818
     
    9999        cssmin: {
    100100            ltr: {
    101                 cwd: SOURCE_DIR,
     101                cwd: BUILD_DIR,
    102102                dest: BUILD_DIR,
    103103                expand: true,
     
    113113                src: BBP_RTL_CSS,
    114114                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                 ]
    124115            }
    125116        },
     
    127118            core: {
    128119                expand: true,
    129                 cwd: SOURCE_DIR,
     120                cwd: BUILD_DIR,
    130121                dest: BUILD_DIR,
    131122                ext: '-rtl.css',
     
    133124                options: { generateExactDuplicates: true }
    134125            },
    135             colors: {
    136                 options: {
    137                     processContent: function( src ) {
    138                         return src.replace( /([^/]+)\.css/gi, '$1-rtl.css' );
    139                     }
    140                 },
    141                 expand: true,
    142                 cwd: BUILD_DIR,
    143                 dest: BUILD_DIR,
    144                 ext: '-rtl.css',
    145                 src: [
    146                     'includes/admin/styles/*/colors.css'
    147                 ]
    148             },
    149126            dynamic: {
    150127                expand: true,
    151                 cwd: SOURCE_DIR,
     128                cwd: BUILD_DIR,
    152129                dest: BUILD_DIR,
    153130                ext: '-rtl.css',
     
    294271            },
    295272            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']
    298275            },
    299276            rtl: {
     
    301278                    return SOURCE_DIR + path;
    302279                } ),
    303                 tasks: [ 'cssjanus:dynamic' ],
     280                tasks: [ 'cssjanus:dynamic', 'cssmin:ltr', 'cssmin:rtl' ],
    304281                options: {
    305282                    interval: 2000,
     
    316293
    317294    // Build tasks.
    318     grunt.registerTask( 'build',         [ 'clean:all', 'copy:files', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'colors', 'cssjanus:colors', 'cssmin:colors','uglify:core', 'jsvalidate:build', 'pot' ] );
    319     grunt.registerTask( 'build-release', [ 'clean:all', 'copy:files', 'cssjanus: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' ] );
    320297
    321298    // Testing tasks.
Note: See TracChangeset for help on using the changeset viewer.