Fix up whitespace and a couple of glitches.
[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/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" />
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/yuicompressor-2.4.2.jar" />
75                         <arg value="--charset" />
76                         <arg value="ANSI" />
77                         <arg value="-o" />
78                         <targetfile />
79                         <mapper type="glob" from="jquery.js" to="jquery.min.js" />
80                 </apply>
81         <echo message="${JQ_MIN} built." />
82     </target>
83
84     <target name="clean">
85         <delete dir="${dist}" />
86     </target>
87
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}" />
94         </target>
95
96 </project>