2009-11-29 21:21:54 +00:00
|
|
|
# Basic Rakefile for building jQuery
|
2009-12-06 22:19:33 +00:00
|
|
|
files = [ "intro", "core", "data", "queue", "event", "support", "selector", "traversing", "attributes", "manipulation", "css", "ajax", "fx", "offset", "dimensions", "outro" ]
|
2009-11-29 21:21:54 +00:00
|
|
|
|
|
|
|
date = `git log -1 | grep Date: | sed 's/[^:]*: *//'`.gsub(/\n/, "")
|
|
|
|
version = `cat version.txt`.gsub(/\n/, "")
|
|
|
|
|
|
|
|
task :default => :jquery
|
|
|
|
|
2009-11-30 20:56:40 +00:00
|
|
|
task :init do
|
|
|
|
sh "if test ! -d test/qunit; then git clone git://github.com/jquery/qunit.git test/qunit; fi"
|
|
|
|
sh "if test ! -d src/sizzle; then git clone git://github.com/jeresig/sizzle.git src/sizzle; fi"
|
|
|
|
sh "cd src/sizzle && git pull origin master &> /dev/null"
|
|
|
|
sh "cd test/qunit && git pull origin master &> /dev/null"
|
|
|
|
end
|
|
|
|
|
|
|
|
task :jquery => [:init, :selector] do
|
2009-11-29 21:21:54 +00:00
|
|
|
sh "mkdir -p dist"
|
|
|
|
|
|
|
|
sh "cat " + files.map {|file| "src/" + file + ".js"}.join(" ") +
|
|
|
|
" | sed 's/Date:./&" + date + "/' | " +
|
|
|
|
" sed s/@VERSION/" + version + "/ > dist/jquery2.js"
|
|
|
|
end
|
|
|
|
|
|
|
|
task :selector do
|
|
|
|
sh "sed '/EXPOSE/r src/sizzle-jquery.js' src/sizzle/sizzle.js > src/selector.js"
|
|
|
|
end
|