git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Defer scriptEval test until first use to prevent Content Security Policy inline-scrip...
[jquery.git]
/
Rakefile
diff --git
a/Rakefile
b/Rakefile
index
38406bd
..
bf7ee2b
100644
(file)
--- a/
Rakefile
+++ b/
Rakefile
@@
-9,7
+9,27
@@
test_dir = File.join( prefix, 'test' )
# setting DIST_DIR before calling rake
dist_dir = ENV['DIST_DIR'] || File.join( prefix, 'dist' )
# 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
+ ajax/jsonp
+ ajax/script
+ ajax/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" )
# Sizzle, QUnit and jQuery files/dirs
sizzle_dir = File.join( src_dir, "sizzle" )
@@
-28,10
+48,10
@@
version = File.read( File.join( prefix, 'version.txt' ) ).strip
# Build tools
rhino = "java -jar #{build_dir}/js.jar"
# 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
# Turn off output other than needed from `sh` and file commands
-verbose(false)
+verbose(false)
# Tasks
task :default => "all"
# Tasks
task :default => "all"
@@
-51,7
+71,7
@@
task :min => jq_min
task :init => [sizzle, qunit] do
sizzle_git = File.join(sizzle_dir, '.git')
qunit_git = File.join(qunit_dir, '.git')
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"
puts "Updating SizzleJS with latest..."
sh "git --git-dir=#{sizzle_git} pull -q origin master"
@@
-61,7
+81,7
@@
end
desc "Removes dist folder, selector.js, and Sizzle/QUnit"
task :clean do
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..."
rm_rf dist_dir
puts "Removing built copy of Sizzle..."
@@
-87,9
+107,13
@@
directory dist_dir
file jq => [dist_dir, base_files].flatten do
puts "Building jquery.js..."
file jq => [dist_dir, base_files].flatten do
puts "Building jquery.js..."
-
+
File.open(jq, 'w') do |f|
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
end
end
@@
-97,9
+121,9
@@
file jq_min => jq do
puts "Building jquery.min.js..."
sh "#{minfier} --js #{jq} --warning_level QUIET --js_output_file #{jq_min}"
puts "Building jquery.min.js..."
sh "#{minfier} --js #{jq} --warning_level QUIET --js_output_file #{jq_min}"
-
+
min = File.read( 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()
# Equivilent of "head"
File.open(jq_min, 'w') do |f|
f.write File.readlines(jq)[0..14].join()
@@
-107,12
+131,12
@@
file jq_min => jq do
end
end
end
end
-file selector => [sizzle, :init] do
+file selector => [sizzle, :init] do
puts "Building selector code from Sizzle..."
puts "Building selector code from Sizzle..."
-
+
File.open(selector, 'w') do |f|
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/, ''
'\0' + File.read( File.join( src_dir, 'sizzle-jquery.js' ))
).gsub(
/^window.Sizzle.+$\n/, ''
@@
-135,4
+159,4
@@
def cat( files )
files.map do |file|
File.read(file)
end.join('')
files.map do |file|
File.read(file)
end.join('')
-end
\ No newline at end of file
+end