Make WordPress Core

Changeset 44246


Ignore:
Timestamp:
12/16/2018 11:33:38 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Build Tools: Revert unrelated changes to Gruntfile.js added in [44245].

See #45156.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r44245 r44246  
    1313                nodesass = require( 'node-sass' ),
    1414                phpUnitWatchGroup = grunt.option( 'group' ),
    15                 themeFiles = [
    16                         'wp-content/themes/index.php',
    17                         'wp-content/themes/twenty*/**'
    18                 ],
    1915                buildFiles = [
    2016                        '*.php',
    … …  
    2420                        'wp-admin/**', // Include everything in wp-admin.
    2521                        'wp-content/index.php',
     22                        'wp-content/themes/index.php',
     23                        'wp-content/themes/twenty*/**',
    2624                        'wp-content/plugins/index.php',
    2725                        'wp-content/plugins/hello.php',
    2826                        'wp-content/plugins/akismet/**'
    29                 ].concat( themeFiles ),
     27                ],
    3028                cleanFiles = [],
    3129                changedFiles = {
    … …  
    130128                        }
    131129                },
    132                 symlink: {
    133                         expanded: {
    134                                 files: [
    135                                   {
    136                                     expand: true,
    137                                     overwrite: true,
    138                                     cwd: SOURCE_DIR,
    139                                     src: [
    140                                                         'wp-admin/*',
    141                                                         'wp-content/uploads/',
    142                                                         'wp-content/index.php',
    143                                                         'wp-content/plugins/*',
    144                                                         'wp-includes/*',
    145                                                         '*.php',
    146                                                         '*.txt',
    147                                                         '*.html',
    148                                                         '!wp-load.php',
    149                                                         '!wp-admin/css',
    150                                                         '!wp-content/themes',
    151                                                         '!wp-includes/css',
    152                                                         '!wp-includes/version.php', // Exclude version.php
    153                                                         '!wp-includes/formatting.php', // Exclude formatting.php
    154                                                         '!wp-includes/embed.php', // Exclude formatting.php
    155                                                         '!index.php', '!wp-admin/index.php',
    156                                                         '!_index.php', '!wp-admin/_index.php'
    157                                                 ],
    158                                     dest: BUILD_DIR
    159                                   },
    160                                         {
    161                                                 'build/wp-config-sample.php': ['wp-config-sample.php'],
    162                                                 'build/index.php': ['src/_index.php'],
    163                                                 'build/wp-admin/index.php': ['src/wp-admin/_index.php']
    164                                         }
    165                                 ]
    166                         }
    167                 },
    168130                copy: {
    169131                        files: {
    … …  
    177139                                                        '!.{svn,git}', // Exclude version control folders.
    178140                                                        '!wp-includes/version.php', // Exclude version.php
    179                                                         '!wp-admin/css/**/*', // Exclude the CSS
    180                                                         '!wp-includes/css/**/*', // Exclude the CSS
    181141                                                        '!index.php', '!wp-admin/index.php',
    182142                                                        '!_index.php', '!wp-admin/_index.php'
    … …  
    193153                                        }
    194154                                ]
    195                         },
    196                         css: {
    197                                 dot: true,
    198                                 expand: true,
    199                                 cwd: SOURCE_DIR,
    200                                 src: [
    201                                         'wp-admin/**/*.css',
    202                                         'wp-includes/**/*.css'
    203                                 ],
    204                                 dest: BUILD_DIR
    205                         },
    206                         themes: {
    207                                 dot: true,
    208                                 expand: true,
    209                                 cwd: SOURCE_DIR,
    210                                 src: themeFiles,
    211                                 dest: BUILD_DIR
    212155                        },
    213156                        'npm-packages': {
    … …  
    398341                                src: SOURCE_DIR + 'wp-includes/version.php',
    399342                                dest: BUILD_DIR + 'wp-includes/version.php'
    400                         },
    401                         'php-buildFiles': {
    402                                 files: {
    403                                         'build/wp-includes/formatting.php': ['src/wp-includes/formatting.php'],
    404                                         'build/wp-includes/embed.php': ['src/wp-includes/embed.php'],
    405                                         'build/wp-load.php': ['src/wp-load.php'],
    406                                 }
    407343                        },
    408344                        dynamic: {
    … …  
    12241160        grunt.registerTask( 'watch', function() {
    12251161                if ( ! this.args.length || this.args.indexOf( 'webpack' ) > -1 ) {
    1226                         grunt.task.run( 'build:dev' );
     1162                        grunt.task.run( 'build' );
    12271163                }
    12281164
    … …  
    13731309        } );
    13741310
    1375         grunt.registerTask( 'uglify:all', [
    1376                 'uglify:core',
    1377                 'uglify:embed',
    1378                 'uglify:jqueryui',
    1379                 'uglify:imgareaselect'
    1380         ] );
    1381 
    13821311        grunt.registerTask( 'copy:js', [
    13831312                'copy:npm-packages',
    … …  
    13871316        ] );
    13881317
    1389         grunt.registerTask( 'copyOrSymlink', function() {
    1390                 var task = grunt.option( 'symlink' ) === true ? 'symlink:expanded' : 'copy:files';
    1391                 grunt.task.run( task );
    1392         } );
    1393 
    1394         grunt.registerTask( 'copy:all', [
    1395                 'copyOrSymlink',
    1396                 'copy:php-buildFiles',
    1397                 'copy:css',
    1398                 'copy:themes',
    1399                 'copy:wp-admin-css-compat-rtl',
    1400                 'copy:wp-admin-css-compat-min',
    1401                 'copy:version',
    1402                 'copy:js'
     1318        grunt.registerTask( 'uglify:all', [
     1319                'uglify:core',
     1320                'uglify:embed',
     1321                'uglify:jqueryui',
     1322                'uglify:imgareaselect'
    14031323        ] );
    14041324
    … …  
    14201340        ] );
    14211341
    1422         grunt.registerTask( 'clean-all', function() {
    1423                 if ( grunt.option( 'symlink' ) === true ) {
    1424                         // clean all symlinks
    1425                         try {
    1426                                 var delSymlinks = require('del-symlinks');
    1427 
    1428                                 var result = delSymlinks.sync(['./build/**']);
    1429                                 grunt.log.writeln( '>> ' + result.length + ' symlinks cleaned.' );
    1430                         } catch ( e ) {
    1431                                 grunt.verbose.error( 'Error:', e.message );
    1432                                 grunt.fail.warn( "Failed to delete symlinks. If you're on Windows, " +
    1433                                                                                                  "running as administrator could resolve this issue.");
    1434                         }
    1435                 }
    1436 
    1437                 grunt.task.run( 'clean:all' );
    1438         } );
    1439 
    1440         grunt.registerTask( 'build:all', [
    1441                 'clean-all',
     1342        grunt.registerTask( 'copy:all', [
     1343                'copy:files',
     1344                'copy:wp-admin-css-compat-rtl',
     1345                'copy:wp-admin-css-compat-min',
     1346                'copy:version',
     1347                'copy:js'
     1348        ] );
     1349
     1350        grunt.registerTask( 'build', [
     1351                'clean:all',
    14421352                'copy:all',
    14431353                'file_append',
    … …  
    14581368        ] );
    14591369
    1460         grunt.registerTask( 'build', function() {
    1461                 grunt.task.run( 'build:all' );
    1462         } );
    1463 
    1464         grunt.registerTask( 'build:dev', function() {
    1465                 try {
    1466                         // Try creating a symlink.
    1467                         fs.symlinkSync( './symlink', './symlinktest');
    1468                         grunt.option( 'symlink', true );
    1469                         // If succeeded, remove it again.
    1470                         fs.unlinkSync( './symlinktest' );
    1471                 } catch( e ) {
    1472                         grunt.verbose.error( 'Error:', e.message );
    1473                         grunt.log.error( "Failed to delete symlinks. Falling back to copying " +
    1474                                                                                          "files instead. If you're on Windows, " +
    1475                                                                                          "running as administrator could resolve this issue.");
    1476                 } finally {
    1477                         grunt.task.run( 'build:all' );
    1478                 }
    1479         } );
    1480 
    14811370        grunt.registerTask( 'prerelease', [
    14821371                'format:php:error',
Note: See TracChangeset for help on using the changeset viewer.