Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/jquery/jquery

  • Loading branch information...
scottjehl
scottjehl committed Jan 13, 2011
2 parents 18fa1fd + a8fa5f2 commit 610ab137da38106f8c464f099a304ae3795c2231
@@ -1,4 +1,4 @@
Copyright (c) 2010 John Resig, http://jquery.com/
Copyright (c) 2011 John Resig, http://jquery.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -24,10 +24,9 @@ BASE_FILES = ${SRC_DIR}/core.js\
${SRC_DIR}/manipulation.js\
${SRC_DIR}/css.js\
${SRC_DIR}/ajax.js\
${SRC_DIR}/xhr.js\
${SRC_DIR}/transports/jsonp.js\
${SRC_DIR}/transports/script.js\
${SRC_DIR}/transports/xhr.js\
${SRC_DIR}/ajax/jsonp.js\
${SRC_DIR}/ajax/script.js\
${SRC_DIR}/ajax/xhr.js\
${SRC_DIR}/effects.js\
${SRC_DIR}/offset.js\
${SRC_DIR}/dimensions.js
@@ -79,13 +78,13 @@ init:
jquery: ${JQ}
jq: ${JQ}

${JQ}: ${MODULES} ${DIST_DIR}
${JQ}: ${MODULES} | ${DIST_DIR}
@@echo "Building" ${JQ}

@@cat ${MODULES} | \
sed 's/.function..jQuery...{//' | \
sed 's/}...jQuery..;//' | \
sed 's/Date:./&'"${DATE}"'/' | \
sed 's/@DATE/'"${DATE}"'/' | \
${VER} > ${JQ};

${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
@@ -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' )

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" ) }
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" )
@@ -31,7 +51,7 @@ rhino = "java -jar #{build_dir}/js.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 +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')

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
puts "Removing Distribution directory: #{dist_dir}..."
puts "Removing Distribution directory: #{dist_dir}..."
rm_rf dist_dir

puts "Removing built copy of Sizzle..."
@@ -87,32 +107,36 @@ 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

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()
f.write min
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/, ''
@@ -63,10 +63,9 @@
<fileset file="src/manipulation.js" />
<fileset file="src/css.js" />
<fileset file="src/ajax.js" />
<fileset file="src/xhr.js" />
<fileset file="src/transports/jsonp.js" />
<fileset file="src/transports/script.js" />
<fileset file="src/transports/xhr.js" />
<fileset file="src/ajax/jsonp.js" />
<fileset file="src/ajax/script.js" />
<fileset file="src/ajax/xhr.js" />
<fileset file="src/effects.js" />
<fileset file="src/offset.js" />
<fileset file="src/dimensions.js" />
@@ -77,7 +76,7 @@
<arg line="log -1 --pretty=format:%ad" />
</exec>
<replaceregexp match="(\(\s*function\s*\(\s*jQuery\s*\)\s*\{)|(\}\s*\)\s*\(\s*jQuery\s*\)\s*;)" flags="g" replace="" file="${JQ}" />
<replaceregexp match="Date: " replace="Date: ${date}" file="${JQ}" />
<replaceregexp match="@DATE" replace="${date}" file="${JQ}" />
<echo message="${JQ} built." />
</target>

0 comments on commit 610ab13

Please sign in to comment.
You can’t perform that action at this time.