aboutsummaryrefslogtreecommitdiffstats
path: root/Rakefile
blob: ebffabfcb43aa86d831183a0aae03cb7c04517b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Basic Rakefile for building jQuery
files = [ "intro", "core", "support", "data", "queue", "event", "selector", "traversing", "attributes", "manipulation", "css", "ajax", "effects", "offset", "dimensions", "outro" ]

date = `git log -1 | grep Date: | sed 's/[^:]*: *//'`.gsub(/\n/, "")
version = `cat version.txt`.gsub(/\n/, "")

task :default => :jquery

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
	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