X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=Rakefile;h=52d789952dc15ff8eb6ce225bcd36a0a43bfc7fb;hb=c1625f6b79b2693ea85f2c16349f708ff203773b;hp=38406bdbb1c61cef820d03172516d674090fc350;hpb=cecd1d87350d0a5c07e2590cedbbda78ad7ae85f;p=jquery.git diff --git a/Rakefile b/Rakefile index 38406bd..52d7899 100644 --- a/Rakefile +++ b/Rakefile @@ -9,7 +9,28 @@ test_dir = File.join( prefix, 'test' ) # setting DIST_DIR before calling rake dist_dir = ENV['DIST_DIR'] || File.join( prefix, 'dist' ) -base_files = %w{intro core support data queue attributes event selector traversing manipulation css ajax effects offset dimensions outro}.map { |js| File.join( src_dir, "#{js}.js" ) } +base_files = %w{ + intro + core + support + data + queue + attributes + event + selector + traversing + manipulation + css + ajax + xhr + transports/jsonp + transports/script + transports/xhr + effects + offset + dimensions + outro +}.map { |js| File.join( src_dir, "#{js}.js" ) } # Sizzle, QUnit and jQuery files/dirs sizzle_dir = File.join( src_dir, "sizzle" ) @@ -28,10 +49,10 @@ version = File.read( File.join( prefix, 'version.txt' ) ).strip # Build tools rhino = "java -jar #{build_dir}/js.jar" -minfier = "java -jar #{build_dir}/google-compiler-20091218.jar" +minfier = "java -jar #{build_dir}/google-compiler-20100917.jar" # Turn off output other than needed from `sh` and file commands -verbose(false) +verbose(false) # Tasks task :default => "all" @@ -51,7 +72,7 @@ task :min => jq_min task :init => [sizzle, qunit] do sizzle_git = File.join(sizzle_dir, '.git') qunit_git = File.join(qunit_dir, '.git') - + puts "Updating SizzleJS with latest..." sh "git --git-dir=#{sizzle_git} pull -q origin master" @@ -61,7 +82,7 @@ end desc "Removes dist folder, selector.js, and Sizzle/QUnit" task :clean do - puts "Removing Distribution directory: #{dist_dir}..." + puts "Removing Distribution directory: #{dist_dir}..." rm_rf dist_dir puts "Removing built copy of Sizzle..." @@ -87,9 +108,13 @@ directory dist_dir file jq => [dist_dir, base_files].flatten do puts "Building jquery.js..." - + File.open(jq, 'w') do |f| - f.write cat(base_files).gsub(/(Date:.)/, "\\1#{date}" ).gsub(/@VERSION/, version) + f.write cat(base_files). + gsub(/@DATE/, date). + gsub(/@VERSION/, version). + gsub(/.function..jQuery...\{/, ''). + gsub(/\}...jQuery..;/, '') end end @@ -97,9 +122,9 @@ file jq_min => jq do puts "Building jquery.min.js..." sh "#{minfier} --js #{jq} --warning_level QUIET --js_output_file #{jq_min}" - + min = File.read( jq_min ) - + # Equivilent of "head" File.open(jq_min, 'w') do |f| f.write File.readlines(jq)[0..14].join() @@ -107,12 +132,12 @@ file jq_min => jq do end end -file selector => [sizzle, :init] do +file selector => [sizzle, :init] do puts "Building selector code from Sizzle..." - + File.open(selector, 'w') do |f| - f.write File.read(sizzle).gsub( - /^.+EXPOSE$\n/, + f.write File.read(sizzle).gsub( + /^.+EXPOSE$\n/, '\0' + File.read( File.join( src_dir, 'sizzle-jquery.js' )) ).gsub( /^window.Sizzle.+$\n/, '' @@ -135,4 +160,4 @@ def cat( files ) files.map do |file| File.read(file) end.join('') -end \ No newline at end of file +end