Split the queue code out from data.js into a dedicated queue.js file (also split...
[jquery.git] / build.xml
1 <project name="jQuery" default="jquery" basedir=".">
2
3     <!--
4     To get jQuery even smaller, remove the modules you don't need by removing the fileset elements
5         in the jquery-target, for example leaving only these:
6
7         <fileset dir="${SRC_DIR}" includes="intro.js" />
8     <fileset dir="${SRC_DIR}" includes="core.js" />
9     <fileset dir="${SRC_DIR}" includes="selector.js" />
10     <fileset dir="${SRC_DIR}" includes="event.js" />
11     <fileset dir="${SRC_DIR}" includes="outro.js" />
12
13         That'd remove ajax, fx and offset support, leaving basic selectors, manipulation and event handling.
14     -->
15
16     <!-- SETUP -->
17
18     <property description="Source Folder" name="SRC_DIR" value="src"  />
19     <property description="Files for parsing etc." name="BUILD_DIR" value="build" />
20     <property description="YUICompressor" name="YUICompressor" value="${BUILD_DIR}/yuicompressor-2.4.2.jar" />
21         <loadfile description="Version to build" property="version" srcfile="version.txt" />
22
23     <property description="Folder for jquery, min, lite and packed target" name="DIST_DIR" value="./dist" />
24
25     <!-- Files names for distribution -->
26     <property name="JQ" value="${DIST_DIR}/jquery.js" />
27     <property name="JQ_LITE" value="${DIST_DIR}/jquery.lite.js" />
28     <property name="JQ_MIN" value="${DIST_DIR}/jquery.min.js" />
29     <property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />
30         <loadfile property="version" srcfile="version.txt" />
31
32     <!-- MAIN -->
33
34     <target name="jquery" description="Main jquery build, concatenates source files and replaces @VERSION">
35         <echo message="Building ${JQ}" />
36         <mkdir dir="${DIST_DIR}" />
37         <concat destfile="${JQ}">
38             <fileset dir="${SRC_DIR}" includes="intro.js" />
39             <fileset dir="${SRC_DIR}" includes="core.js" />
40             <fileset dir="${SRC_DIR}" includes="data.js" />
41             <fileset dir="${SRC_DIR}" includes="queue.js" />
42             <fileset dir="${SRC_DIR}" includes="event.js" />
43             <fileset dir="${SRC_DIR}" includes="support.js" />
44             <fileset dir="${SRC_DIR}" includes="selector.js" />
45             <fileset dir="${SRC_DIR}" includes="traversing.js" />
46             <fileset dir="${SRC_DIR}" includes="attributes.js" />
47             <fileset dir="${SRC_DIR}" includes="manipulation.js" />
48             <fileset dir="${SRC_DIR}" includes="css.js" />
49             <fileset dir="${SRC_DIR}" includes="ajax.js" />
50             <fileset dir="${SRC_DIR}" includes="fx.js" />
51             <fileset dir="${SRC_DIR}" includes="offset.js" />
52             <fileset dir="${SRC_DIR}" includes="dimensions.js" />
53             <fileset dir="${SRC_DIR}" includes="outro.js" />
54         </concat>
55         <replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${JQ}" />
56                 <replaceregexp match="Date: " replace="Date: ${date}" file="${JQ}" />
57                 <replaceregexp match="Revision: " replace="Revision: ${revision}" file="${JQ}" />
58         <echo message="${JQ} built." />
59     </target>
60
61     <target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
62         <echo message="Building ${JQ_MIN}" />
63                 <apply executable="java" parallel="false" verbose="true" dest="${DIST_DIR}">
64                         <fileset dir="${DIST_DIR}">
65                                 <include name="jquery.js" />
66                         </fileset>
67                         <arg line="-jar" />
68                         <arg path="${YUICompressor}" />
69                         <arg value="--charset" />
70                         <arg value="ANSI" />
71                         <arg value="-o" />
72                         <targetfile />
73                         <mapper type="glob" from="jquery.js" to="jquery.min.js" />
74                 </apply>
75         <echo message="${JQ_MIN} built." />
76     </target>
77
78     <target name="pack" depends="jquery" description="Remove all comments and whitespace and compress">
79         <echo message="Building ${JQ_PACK}" />
80         <java jar="${JAR}" fork="true">
81             <arg value="${BUILD_DIR}/build/pack.js" />
82             <arg value="${JQ}" />
83             <arg value="${JQ_PACK}" />
84         </java>
85         <echo message="${JQ_PACK} built." />
86     </target>
87
88         <target name="runtest">
89                 <echo message="Running Automated Test Suite" />
90                 <java jar="${JAR}" fork="true">
91             <arg value="${BUILD_DIR}/runtest/test.js" />
92         </java>
93                 <echo message="Test Suite Finished" />
94         </target>
95
96     <target name="clean">
97         <delete dir="${DIST_DIR}" />
98     </target>
99
100     <target name="all" depends="clean,jquery,min,pack">
101         <echo message="Build complete." />
102     </target>
103         
104         <target name="openAjaxMetadata">
105                 <property name="target" value="openAjaxMetadata-jquery-${version}.xml" />
106                 <delete file="dist/jquery-*.xml" />
107                 <get src="http://www.exfer.net/jquery/createjQueryXMLDocs.py?version=1.3" dest="${target}" />
108                 <xslt includes="${target}" excludes="build.xml" destdir="./dist" style="build/style.xsl" extension=".xml" />
109                 <delete file="${target}" />
110         </target>
111
112 </project>