added version to all builds; changed current version to 1.2.2-pre - to be updated...
[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="Rhino JS Engine" name="JAR" value="${BUILD_DIR}/js.jar" />
21
22     <property description="Folder for jquery, min, lite and packed target" name="DIST_DIR" value="./dist" />
23
24     <!-- Files names for distribution -->
25     <property name="JQ" value="${DIST_DIR}/jquery.js" />
26     <property name="JQ_LITE" value="${DIST_DIR}/jquery.lite.js" />
27     <property name="JQ_MIN" value="${DIST_DIR}/jquery.min.js" />
28     <property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />
29
30     <!-- MAIN -->
31
32     <target name="jquery" description="Main jquery build, concatenates source files and replaces @VERSION">
33         <echo message="Building ${JQ}" />
34         <mkdir dir="${DIST_DIR}" />
35         <concat destfile="${JQ}">
36             <fileset dir="${SRC_DIR}" includes="intro.js" />
37             <fileset dir="${SRC_DIR}" includes="core.js" />
38             <fileset dir="${SRC_DIR}" includes="selector.js" />
39             <fileset dir="${SRC_DIR}" includes="event.js" />
40             <fileset dir="${SRC_DIR}" includes="ajax.js" />
41             <fileset dir="${SRC_DIR}" includes="fx.js" />
42             <fileset dir="${SRC_DIR}" includes="offset.js" />
43             <fileset dir="${SRC_DIR}" includes="outro.js" />
44         </concat>
45         <java jar="${JAR}" fork="true">
46             <arg value="${BUILD_DIR}/build/version.js" />
47             <arg value="${JQ}" />
48         </java>
49         <echo message="${JQ} built." />
50     </target>
51
52     <target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
53         <echo message="Building ${JQ_MIN}" />
54         <java jar="${JAR}" fork="true">
55             <arg value="${BUILD_DIR}/build/min.js" />
56             <arg value="${JQ}" />
57             <arg value="${JQ_MIN}" />
58         </java>
59         <echo message="${JQ_MIN} built." />
60     </target>
61
62     <target name="pack" depends="jquery" description="Remove all comments and whitespace and compress">
63         <echo message="Building ${JQ_PACK}" />
64         <java jar="${JAR}" fork="true">
65             <arg value="${BUILD_DIR}/build/pack.js" />
66             <arg value="${JQ}" />
67             <arg value="${JQ_PACK}" />
68         </java>
69         <echo message="${JQ_PACK} built." />
70     </target>
71
72         <target name="runtest">
73                 <echo message="Running Automated Test Suite" />
74                 <java jar="${JAR}" fork="true">
75             <arg value="${BUILD_DIR}/runtest/test.js" />
76         </java>
77                 <echo message="Test Suite Finished" />
78         </target>
79
80     <target name="clean">
81         <delete dir="${DIST_DIR}" />
82     </target>
83
84     <target name="all" depends="clean,jquery,min,pack">
85         <echo message="Build complete." />
86     </target>
87
88 </project>