1 <project name="jQuery" default="jquery" basedir=".">
3 <loadfile property="version" srcfile="version.txt" />
4 <property description="Folder for jquery and min target" name="dist" value="./dist" />
6 <property name="JQ" value="${dist}/jquery.js" />
7 <property name="JQ_MIN" value="${dist}/jquery.min.js" />
9 <loadfile property="sizzle-exports" srcfile="src/sizzle-jquery.js" />
11 <available property="qunit" file="test/qunit" />
12 <available property="sizzle" file="src/sizzle" />
14 <target name="qunit-clone" unless="qunit">
15 <exec executable="git" outputproperty="git-qunit" >
16 <arg line="clone git://github.com/jquery/qunit.git test/qunit"/>
18 <echo message="git clone qunit: ${git-qunit}" />
20 <target name="qunit-pull" if="qunit">
21 <exec executable="git" outputproperty="git-qunit" dir="test/qunit" >
22 <arg line="pull origin master"/>
24 <echo message="git pull sizzle: ${git-qunit}" />
26 <target name="sizzle-clone" unless="sizzle">
27 <exec executable="git" outputproperty="git-sizzle" >
28 <arg line="clone git://github.com/jeresig/sizzle.git src/sizzle"/>
30 <echo message="git clone sizzle: ${git-sizzle}" />
32 <target name="sizzle-pull" if="sizzle">
33 <exec executable="git" outputproperty="git-sizzle" dir="src/sizzle" >
34 <arg line="pull origin master"/>
36 <echo message="git pull sizzle: ${git-sizzle}" />
39 <target name="jquery" depends="qunit-clone,qunit-pull,sizzle-clone,sizzle-pull" description="Main jquery build, concatenates source files and replaces @VERSION">
40 <echo message="Building ${JQ}" />
41 <copy file="src/sizzle/sizzle.js" tofile="src/selector.js" overwrite="true" />
42 <replaceregexp match="// EXPOSE" replace="${sizzle-exports}" file="src/selector.js" />
43 <mkdir dir="${dist}" />
44 <concat destfile="${JQ}">
45 <fileset file="src/intro.js" />
46 <fileset file="src/core.js" />
47 <fileset file="src/support.js" />
48 <fileset file="src/data.js" />
49 <fileset file="src/queue.js" />
50 <fileset file="src/event.js" />
51 <fileset file="src/selector.js" />
52 <fileset file="src/traversing.js" />
53 <fileset file="src/attributes.js" />
54 <fileset file="src/manipulation.js" />
55 <fileset file="src/css.js" />
56 <fileset file="src/ajax.js" />
57 <fileset file="src/fx.js" />
58 <fileset file="src/offset.js" />
59 <fileset file="src/dimensions.js" />
60 <fileset file="src/outro.js" />
62 <replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${JQ}" />
63 <replaceregexp match="Date: " replace="Date: ${date}" file="${JQ}" />
64 <echo message="${JQ} built." />
67 <target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
68 <echo message="Building ${JQ_MIN}" />
69 <apply executable="java" parallel="false" verbose="true" dest="${dist}">
70 <fileset dir="${dist}">
71 <include name="jquery.js" />
74 <arg path="build/yuicompressor-2.4.2.jar" />
75 <arg value="--charset" />
79 <mapper type="glob" from="jquery.js" to="jquery.min.js" />
81 <echo message="${JQ_MIN} built." />
85 <delete dir="${dist}" />
88 <target name="openAjaxMetadata">
89 <property name="target" value="openAjaxMetadata-jquery-${version}.xml" />
90 <delete file="dist/jquery-*.xml" />
91 <get src="http://www.exfer.net/jquery/createjQueryXMLDocs.py?version=1.3" dest="${target}" />
92 <xslt includes="${target}" excludes="build.xml" destdir="./dist" style="build/style.xsl" extension=".xml" />
93 <delete file="${target}" />