Skip to:
Content

bbPress.org

Changeset 5614


Ignore:
Timestamp:
02/05/2015 03:07:24 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Bring Gruntfile.js tasks up to speed with BuddyPress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r5483 r5614  
    11/* jshint node:true */
     2/* global module */
    23module.exports = function( grunt ) {
    34    var path = require( 'path' ),
    4     SOURCE_DIR = 'src/',
    5     BUILD_DIR = 'build/',
    6 
    7     BBP_RTL_CSS = [
    8         'includes/admin/css/admin-rtl.css',
    9         'includes/admin/styles/*/colors-rtl.css',
    10         'templates/default/css/bbpress-rtl.css'
    11     ],
    12 
    13     BBP_LTR_CSS = [
    14         'includes/admin/css/admin.css',
    15         'includes/admin/styles/*/colors.css',
    16         'templates/default/css/bbpress.css'
    17     ],
    18 
    19     BBP_JS = [
    20         'includes/admin/js/*.js',
    21         'templates/default/js/*.js'
    22     ],
    23 
    24     BBP_EXCLUDED_FILES = [
    25         // Ignore these
    26         '!**/.{svn,git}/**',
    27         '!.editorconfig',
    28         '!.gitignore',
    29         '!.jshintrc',
    30         '!.travis.yml',
    31         '!build/**',
    32         '!Gruntfile.js',
    33         '!node_modules/**',
    34         '!npm-debug.log',
    35         '!package.json',
    36 
    37         // bbPress SCSS CSS source files
    38         '!**/*.scss',
    39 
    40         // bbPress PHPUnit tests
    41         '!tests/**',
    42         '!phpunit.xml',
    43         '!phpunit.xml.dist'
    44     ];
     5        SOURCE_DIR = 'src/',
     6        BUILD_DIR = 'build/',
     7
     8        BBP_RTL_CSS = [
     9            'includes/admin/css/admin-rtl.css',
     10            'includes/admin/styles/*/colors-rtl.css',
     11            'templates/default/css/bbpress-rtl.css'
     12        ],
     13
     14        BBP_LTR_CSS = [
     15            'includes/admin/css/admin.css',
     16            'includes/admin/styles/*/colors.css',
     17            'templates/default/css/bbpress.css'
     18        ],
     19
     20        BBP_JS = [
     21            'includes/admin/js/*.js',
     22            'templates/default/js/*.js'
     23        ],
     24
     25        BBP_EXCLUDED_FILES = [
     26            // Ignore these
     27            '!**/.{svn,git}/**',
     28            '!.editorconfig',
     29            '!.gitignore',
     30            '!.jshintrc',
     31            '!.travis.yml',
     32            '!build/**',
     33            '!Gruntfile.js',
     34            '!node_modules/**',
     35            '!npm-debug.log',
     36            '!package.json',
     37
     38            // bbPress SCSS CSS source files
     39            '!**/*.scss',
     40
     41            // bbPress PHPUnit tests
     42            '!tests/**',
     43            '!phpunit.xml',
     44            '!phpunit.xml.dist'
     45        ];
    4546
    4647    // Load tasks.
    4748    require( 'matchdep' ).filterDev([ 'grunt-*', '!grunt-legacy-util' ]).forEach( grunt.loadNpmTasks );
     49
    4850    // Load legacy utils
    49     grunt.util = require('grunt-legacy-util');
     51    grunt.util = require( 'grunt-legacy-util' );
    5052
    5153    // Project configuration.
     
    317319
    318320    // Color schemes task.
    319     grunt.registerTask('colors', ['sass:colors']);
     321    grunt.registerTask( 'colors', ['sass:colors'] );
    320322
    321323    // Build tasks.
    322     grunt.registerTask( 'build',         [ 'clean:all', 'copy:files', 'colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'uglify:core', 'jsvalidate:build', 'makepot' ] );
    323     grunt.registerTask( 'build-release', [ 'clean:all', 'copy:files', 'colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'uglify:core', 'jsvalidate:build', 'checktextdomain', 'makepot', 'phpunit' ] );
     324    grunt.registerTask( 'src',     ['jsvalidate', 'jshint', 'cssjanus'] );
     325    grunt.registerTask( 'commit',  ['src', 'checktextdomain'] );
     326    grunt.registerTask( 'build',   [ 'clean:all', 'copy:files', 'colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'uglify:core', 'jsvalidate:build', 'makepot' ] );
     327    grunt.registerTask( 'release', [ 'build', 'checktextdomain' ] );
    324328
    325329    // PHPUnit test task.
     
    332336    } );
    333337
     338    // PHPUnit test task.
     339    grunt.registerTask( 'test', 'Run all PHPUnit test tasks.', ['phpunit'] );
     340
    334341    // JavaScript test task.
    335     grunt.registerTask( 'jstest', 'Runs all javascript tasks.', [ 'jsvalidate', 'jshint' ] );
    336 
    337     // Travis CI task.
    338     grunt.registerTask( 'travis', ['jshint', 'phpunit'] );
     342    grunt.registerTask( 'jstest', 'Runs all JavaScript tasks.', [ 'jsvalidate', 'jshint' ] );
     343
     344    // Travis CI Task
     345    grunt.registerTask( 'travis', ['jsvalidate', 'jshint', 'checktextdomain', 'test'] );
    339346
    340347    // Patch task.
    341     grunt.renameTask('patch_wordpress', 'patch');
     348    grunt.renameTask( 'patch_wordpress', 'patch' );
    342349
    343350    // Default task.
    344     grunt.registerTask( 'default', [ 'build' ] );
     351    grunt.registerTask( 'default', ['src'] );
    345352
    346353    // Add a listener to the watch task.
Note: See TracChangeset for help on using the changeset viewer.