Handle auto-running of the TestSwarm injection script in the test suite.
[jquery.git] / build.xml
1 <project name="jQuery" default="jquery" basedir=".">
2
3         <loadfile property="version" srcfile="version.txt" />
4     <property description="Folder for jquery and min target" name="dist" value="./dist" />
5
6     <property name="JQ" value="${dist}/jquery.js" />
7     <property name="JQ_MIN" value="${dist}/jquery.min.js" />
8         
9         <loadfile property="sizzle-exports" srcfile="src/sizzle-jquery.js" />
10         
11         <available property="qunit" file="test/qunit" />
12         <available property="sizzle" file="src/sizzle" />
13         
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"/>  
17                 </exec>
18                 <echo message="git clone qunit: ${git-qunit}" />
19         </target>
20         <target name="qunit-pull" if="qunit">
21                 <exec executable="git" outputproperty="git-qunit" dir="test/qunit" >  
22                         <arg line="pull origin master"/>  
23                 </exec> 
24                 <echo message="git pull sizzle: ${git-qunit}" />
25         </target>
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"/>  
29                 </exec> 
30                 <echo message="git clone sizzle: ${git-sizzle}" />
31         </target>
32         <target name="sizzle-pull" if="sizzle">
33                 <exec executable="git" outputproperty="git-sizzle" dir="src/sizzle" >  
34                         <arg line="pull origin master"/>  
35                 </exec> 
36                 <echo message="git pull sizzle: ${git-sizzle}" />
37         </target>
38
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/attributes.js" />
51             <fileset file="src/event.js" />
52             <fileset file="src/selector.js" />
53             <fileset file="src/traversing.js" />
54             <fileset file="src/manipulation.js" />
55             <fileset file="src/css.js" />
56             <fileset file="src/ajax.js" />
57             <fileset file="src/effects.js" />
58             <fileset file="src/offset.js" />
59             <fileset file="src/dimensions.js" />
60             <fileset file="src/outro.js" />
61         </concat>
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." />
65     </target>
66
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" />
72                         </fileset>
73                         <arg line="-jar" />
74                         <arg path="build/google-compiler-20091218.jar" />
75                         <arg value="--warning_level" />
76                         <arg value="QUIET" />
77                         <arg value="--js_output_file" />
78                         <targetfile />
79                         <arg value="--js" />
80                         <mapper type="glob" from="jquery.js" to="tmpmin" />
81                 </apply>
82                 <concat destfile="${JQ_MIN}">
83                         <filelist files="${JQ}, dist/tmpmin"/>
84                         <filterchain>
85                                 <headfilter lines="15"/>
86                         </filterchain>
87                 </concat>
88                 <concat destfile="${JQ_MIN}" append="yes">
89                         <filelist files="dist/tmpmin"/>
90                 </concat>
91                 <delete file="dist/tmpmin"/>
92         <echo message="${JQ_MIN} built." />
93     </target>
94
95     <target name="clean">
96         <delete dir="${dist}" />
97     </target>
98
99         <target name="openAjaxMetadata">
100                 <property name="target" value="openAjaxMetadata-jquery-${version}.xml" />
101                 <delete file="dist/jquery-*.xml" />
102                 <get src="http://www.exfer.net/jquery/createjQueryXMLDocs.py?version=1.3" dest="${target}" />
103                 <xslt includes="${target}" excludes="build.xml" destdir="./dist" style="build/style.xsl" extension=".xml" />
104                 <delete file="${target}" />
105         </target>
106
107 </project>