Make WordPress Core

Ticket #44256: 44256.3.diff

File 44256.3.diff, 2.1 KB (added by adamsilverstein, 7 years ago)
  • Gruntfile.js

    diff --git Gruntfile.js Gruntfile.js
    index 86839df62c..ad5a604fb2 100644
    module.exports = function(grunt) { 
    1111                BUILD_DIR = 'build/',
    1212                BANNER_TEXT = '/*! This file is auto-generated */',
    1313                autoprefixer = require( 'autoprefixer' ),
    14                 phpUnitWatchGroup = grunt.option( 'group' );
     14                phpUnitWatchGroup = grunt.option( 'group' ),
     15                buildFiles = [
     16                        '*.php',
     17                        '*.txt',
     18                        '*.html',
     19                        'wp-includes/**', // Include everything in wp-includes.
     20                        'wp-admin/**', // Include everything in wp-admin.
     21                        'wp-content/index.php',
     22                        'wp-content/themes/index.php',
     23                        'wp-content/themes/twentyten',
     24                        'wp-content/themes/twentyeleven',
     25                        'wp-content/themes/twentytwelve',
     26                        'wp-content/themes/twentythirteen',
     27                        'wp-content/themes/twentyfourteen',
     28                        'wp-content/themes/twentyfifteen',
     29                        'wp-content/themes/twentysixteen',
     30                        'wp-content/themes/twentyseventeen',
     31                        'wp-content/plugins/index.php',
     32                        'wp-content/plugins/hello.php',
     33                        'wp-content/plugins/akismet'
     34                ],
     35                cleanFiles = [];
     36
     37        buildFiles.forEach( function( buildFile ) {
     38                cleanFiles.push( BUILD_DIR + buildFile );
     39        } );
    1540
    1641        if ( 'watch:phpunit' === grunt.cli.tasks[ 0 ] && ! phpUnitWatchGroup ) {
    1742                grunt.log.writeln();
    module.exports = function(grunt) { 
    82107                        }
    83108                },
    84109                clean: {
    85                         all: [BUILD_DIR],
     110                        plugins: [BUILD_DIR + 'wp-content/plugins'],
     111                        themes: [BUILD_DIR + 'wp-content/themes'],
     112                        all: cleanFiles,
    86113                        js: [BUILD_DIR + 'wp-admin/js/', BUILD_DIR + 'wp-includes/js/'],
    87114                        dynamic: {
    88115                                dot: true,
    module.exports = function(grunt) { 
    111138                                                dot: true,
    112139                                                expand: true,
    113140                                                cwd: SOURCE_DIR,
    114                                                 src: [
    115                                                         '**',
     141                                                src: buildFiles.concat( [
    116142                                                        '!js/**', // JavaScript is extracted into separate copy tasks.
    117                                                         '!**/.{svn,git}/**', // Ignore version control directories.
     143                                                        '!.{svn,git}', // Exclude version control folders.
    118144                                                        '!wp-includes/version.php', // Exclude version.php
    119145                                                        '!index.php', '!wp-admin/index.php',
    120146                                                        '!_index.php', '!wp-admin/_index.php'
    121                                                 ],
     147                                                ] ),
    122148                                                dest: BUILD_DIR
    123149                                        },
    124150                                        {