diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2013-02-26 21:59:08 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-03-25 14:45:45 -0400 |
commit | 131de8c80ed8d184104122315196e5aba9d8bb63 (patch) | |
tree | 90702f03a1bdd5fa08d7f5c33c3ec80d95b8082d /Gruntfile.js | |
parent | 336cf71a54a339c65353d461ea3ffdbbbd871d39 (diff) | |
download | jquery-131de8c80ed8d184104122315196e5aba9d8bb63.tar.gz jquery-131de8c80ed8d184104122315196e5aba9d8bb63.zip |
No ticket: Grunt changes from 2.0 selector-native
(cherry picked from commits 1083f82d1ee0c8f15a66be15e6184294a69d4420 8be9cd1ce71de8affa32a85b596c1bfed2e714a6 054c6946d4f86e4ba5ce6284554c8cacd7498e93)
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index a8dd4d864..7180a8a27 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -22,7 +22,7 @@ module.exports = function( grunt ) { files: distpaths }, selector: { - destFile: "src/selector.js", + destFile: "src/selector-sizzle.js", apiFile: "src/sizzle-jquery.js", srcFile: "src/sizzle/dist/sizzle.js" }, @@ -39,10 +39,9 @@ module.exports = function( grunt ) { "src/queue.js", "src/attributes.js", "src/event.js", - "src/selector.js", + "src/selector-sizzle.js", "src/traversing.js", "src/manipulation.js", - { flag: "css", src: "src/css.js" }, "src/serialize.js", { flag: "event-alias", src: "src/event-alias.js" }, @@ -151,8 +150,7 @@ module.exports = function( grunt ) { }); }); - // Build src/selector.js - grunt.registerTask( "selector", "Build src/selector.js", function() { + grunt.registerTask( "selector", "Build Sizzle-based selector module", function() { var cfg = grunt.config("selector"), name = cfg.destFile, @@ -196,7 +194,7 @@ module.exports = function( grunt ) { // Rejoin the pieces compiled = parts.join(""); - grunt.verbose.write("Injected sizzle-jquery.js into sizzle.js"); + grunt.verbose.writeln("Injected " + cfg.apiFile + " into " + cfg.srcFile); // Write concatenated source to file, and ensure newline-only termination grunt.file.write( name, compiled.replace( /\x0d\x0a/g, "\x0a" ) ); @@ -334,37 +332,47 @@ module.exports = function( grunt ) { var flag = filepath.flag, specified = false, omit = false, - message = ""; + messages = []; if ( flag ) { if ( excluded[ flag ] !== undefined ) { - message = ( "Excluding " + flag ).red; + messages.push([ + ( "Excluding " + flag ).red, + ( "(" + filepath.src + ")" ).grey + ]); specified = true; - omit = true; - } else { - message = ( "Including " + flag ).green; + omit = !filepath.alt; + if ( !omit ) { + flag += " alternate"; + filepath.src = filepath.alt; + } + } + if ( excluded[ flag ] === undefined ) { + messages.push([ + ( "Including " + flag ).green, + ( "(" + filepath.src + ")" ).grey + ]); // If this module was actually specified by the - // builder, then st the flag to include it in the + // builder, then set the flag to include it in the // output list if ( modules[ "+" + flag ] ) { specified = true; } } + filepath = filepath.src; + // Only display the inclusion/exclusion list when handling // an explicit list. // // Additionally, only display modules that have been specified // by the user if ( explicit && specified ) { - grunt.log.writetableln([ 27, 30 ], [ - message, - ( "(" + filepath.src + ")").grey - ]); + messages.forEach(function( message ) { + grunt.log.writetableln( [ 27, 30 ], message ); + }); } - - filepath = filepath.src; } if ( !omit ) { |