Added tests for global and local ajax handlers, added global option to $.ajax to...
[jquery.git] / build.xml
1 <project name="jQuery" default="all" basedir=".">\r
2         \r
3         <!-- SETUP -->
4
5     <property name="SRC_DIR" value="src" />
6     <property name="BUILD_DIR" value="build" />
7     <property name="JAR" value="${BUILD_DIR}/js.jar" />\r
8         \r
9         <property name="PLUGIN_DIR" location="../plugins" />\r
10         <property name="PLUGINS" value="none" />\r
11         
12     <property name="PREFIX" value="." />
13     <property name="DOCS_DIR" value="${PREFIX}/docs" />
14     <property name="TEST_DIR" value="${PREFIX}/test" />
15     <property name="DIST_DIR" value="${PREFIX}/dist" />
16
17     <property name="JQ" value="${DIST_DIR}/jquery.js" />
18     <property name="JQ_LITE" value="${DIST_DIR}/jquery.lite.js" />
19     <property name="JQ_MIN" value="${DIST_DIR}/jquery.min.js" />
20     <property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />\r
21 \r
22         <!-- MAIN -->\r
23         \r
24     <target name="jquery">
25         <echo message="Building ${JQ}" />
26         <mkdir dir="${DIST_DIR}" />
27         <concat destfile="${JQ}">\r
28                 <fileset dir="${SRC_DIR}" includes="intro.js" />
29             <fileset dir="${SRC_DIR}" includes="jquery/*.js" />
30             <fileset dir="${SRC_DIR}" includes="event/*.js" />
31             <fileset dir="${SRC_DIR}" includes="fx/*.js" />
32             <fileset dir="${SRC_DIR}" includes="ajax/*.js" />\r
33                 <fileset dir="${PLUGIN_DIR}" includes="${PLUGINS}" />\r
34                 <fileset dir="${SRC_DIR}" includes="outro.js" />
35         </concat>
36         <echo message="${JQ} built." />
37     </target>
38
39     <target name="lite" depends="jquery">
40         <echo message="Building ${JQ_LITE}" />
41         <java jar="${JAR}" fork="true">
42             <arg value="${BUILD_DIR}/build/lite.js" />
43             <arg value="${JQ}" />
44             <arg value="${JQ_LITE}" />
45         </java>
46         <echo message="${JQ_LITE} built." />
47     </target>
48
49     <target name="min" depends="jquery">
50         <echo message="Building ${JQ_MIN}" />
51         <java jar="${JAR}" fork="true">
52             <arg value="${BUILD_DIR}/build/min.js" />
53             <arg value="${JQ}" />
54             <arg value="${JQ_MIN}" />
55         </java>
56         <echo message="${JQ_MIN} built." />
57     </target>
58
59     <target name="pack" depends="jquery">
60         <echo message="Building ${JQ_PACK}" />
61         <java jar="${JAR}" fork="true">
62             <arg value="${BUILD_DIR}/build/pack.js" />
63             <arg value="${JQ}" />
64             <arg value="${JQ_PACK}" />
65         </java>
66         <echo message="${JQ_PACK} built." />
67     </target>
68
69     <target name="test" depends="jquery">
70         <echo message="Building Test Suite" />
71         <delete dir="${TEST_DIR}" />
72         <mkdir dir="${TEST_DIR}/data" />\r
73         <copy todir="${TEST_DIR}/data">\r
74                 <fileset dir="${BUILD_DIR}/test/data/" />\r
75         </copy>\r
76         <java jar="${JAR}" fork="true">
77             <arg value="${BUILD_DIR}/test/test.js" />
78             <arg value="${JQ}" />
79             <arg value="${TEST_DIR}" />
80         </java>
81         <echo message="Test Suite built." />
82     </target>
83
84     <target name="docs" depends="jquery">
85         <echo message="Building Documentation" />
86         <delete dir="${DOCS_DIR}" />
87         <mkdir dir="${DOCS_DIR}/data" />
88         <copy todir="${DOCS_DIR}" file="${BUILD_DIR}/docs/.htaccess" />
89         <mkdir dir="${DOCS_DIR}/js" />
90         <copy todir="${DOCS_DIR}/js" >
91             <fileset dir="${BUILD_DIR}/docs/js">
92                 <include name="**/*.js"/>
93             </fileset>
94         </copy>
95                 <copy todir="${DOCS_DIR}/style" >
96             <fileset dir="${BUILD_DIR}/docs/style">
97                 <include name="**"/>
98             </fileset>
99         </copy>
100         <java jar="${JAR}" fork="true">
101             <arg value="${BUILD_DIR}/docs/docs.js" />
102             <arg value="${JQ}" />
103             <arg value="${DOCS_DIR}" />
104         </java>
105         <echo message="Documentation built." />
106     </target>
107
108     <target name="clean">
109         <delete dir="${DOCS_DIR}" />
110         <delete dir="${TEST_DIR}" />
111         <delete dir="${DIST_DIR}" />
112     </target>
113
114     <target name="all" depends="clean,jquery,lite,min,pack,docs,test" >
115         <echo message="Build complete." />
116     </target>\r
117         \r
118         <!-- PLUGINS -->\r
119         \r
120         <target name="ifx" description="Build jquery with Interface fx plugins">\r
121                 <antcall target="jquery">\r
122                         <param name="PLUGINS" value="interface/ifx*.js" />\r
123                 </antcall>\r
124         </target>\r
125         \r
126         <target name="cookieFormPager" description="Build jquery with cookie, form and pager plugins">\r
127                 <antcall target="jquery">\r
128                         <param name="PLUGINS" value="cookie/*.js,form/*.js,pager/*.js" />\r
129                 </antcall>\r
130         </target>\r
131
132 </project>