Skip to:
Content

bbPress.org

Changeset 5649


Ignore:
Timestamp:
03/23/2015 08:28:40 AM (12 years ago)
Author:
netweb
Message:

Bring Gruntfile.js tasks up to speed with BuddyPress

  • Adds a src target for jsvalidate to validate JavaScript files in the /src folder
  • WordPress JavaScript coding standards improvements
  • See also r5614

Props netweb. Fixes #2766

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r5614 r5649  
    2424
    2525                BBP_EXCLUDED_FILES = [
     26
    2627                        // Ignore these
    2728                        '!**/.{svn,git}/**',
    … …  
    5354        // Project configuration.
    5455        grunt.initConfig({
    55                 pkg: grunt.file.readJSON('package.json'),
     56                pkg: grunt.file.readJSON( 'package.json' ),
    5657                checktextdomain: {
    5758                        options: {
    … …  
    205206                                        src: BUILD_DIR + '/**/*.js'
    206207                                }
     208                        },
     209                        src: {
     210                                files: {
     211                                        src: SOURCE_DIR + '/**/*.js'
     212                                }
    207213                        }
    208214                },
    … …  
    232238                        'default': {
    233239                                cmd: 'phpunit',
    234                                 args: ['-c', 'phpunit.xml.dist']
     240                                args: [ '-c', 'phpunit.xml.dist' ]
    235241                        },
    236242                        multisite: {
    237243                                cmd: 'phpunit',
    238                                 args: ['-c', 'tests/phpunit/multisite.xml']
     244                                args: [ '-c', 'tests/phpunit/multisite.xml' ]
    239245                        }
    240246                },
    … …  
    245251                                dest: BUILD_DIR,
    246252                                ext: '.css',
    247                                 src: ['includes/admin/styles/*/colors.scss'],
     253                                src: [ 'includes/admin/styles/*/colors.scss' ],
    248254                                options: {
    249255                                        outputStyle: 'expanded'
    … …  
    276282                                files: [
    277283                                        SOURCE_DIR + '**',
     284
    278285                                        // Ignore version control directories.
    279286                                        '!' + SOURCE_DIR + '**/.{svn,git}/**'
    … …  
    287294                        },
    288295                        colors: {
    289                                 files: [SOURCE_DIR + 'includes/admin/styles/*/colors.scss'],
    290                                 tasks: ['sass:colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl']
     296                                files: [ SOURCE_DIR + 'includes/admin/styles/*/colors.scss' ],
     297                                tasks: [ 'sass:colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl' ]
    291298                        },
    292299                        config: {
    … …  
    319326
    320327        // Color schemes task.
    321         grunt.registerTask( 'colors', ['sass:colors'] );
     328        grunt.registerTask( 'colors', [ 'sass:colors' ] );
    322329
    323330        // Build tasks.
    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' ] );
     331        grunt.registerTask( 'src',     [ 'jsvalidate:src', 'jshint' ] );
     332        grunt.registerTask( 'commit',  [ 'src', 'checktextdomain' ] );
     333        grunt.registerTask( 'build',   [ 'commit', 'clean:all', 'copy:files', 'colors', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'uglify:core', 'jsvalidate:build', 'makepot' ] );
     334        grunt.registerTask( 'release', [ 'build' ] );
    328335
    329336        // PHPUnit test task.
    … …  
    337344
    338345        // PHPUnit test task.
    339         grunt.registerTask( 'test', 'Run all PHPUnit test tasks.', ['phpunit'] );
     346        grunt.registerTask( 'test', 'Run all PHPUnit test tasks.', [ 'phpunit' ] );
    340347
    341348        // JavaScript test task.
    342         grunt.registerTask( 'jstest', 'Runs all JavaScript tasks.', [ 'jsvalidate', 'jshint' ] );
     349        grunt.registerTask( 'jstest', 'Runs all JavaScript tasks.', [ 'jsvalidate:src', 'jshint' ] );
    343350
    344351        // Travis CI Task
    345         grunt.registerTask( 'travis', ['jsvalidate', 'jshint', 'checktextdomain', 'test'] );
     352        grunt.registerTask( 'travis', [ 'jsvalidate:src', 'jshint', 'checktextdomain', 'test' ] );
    346353
    347354        // Patch task.
    … …  
    349356
    350357        // Default task.
    351         grunt.registerTask( 'default', ['src'] );
     358        grunt.registerTask( 'default', [ 'src' ] );
    352359
    353360        // Add a listener to the watch task.
Note: See TracChangeset for help on using the changeset viewer.