Fix for jQuery.clean that caused Safari to crash with newline characters
[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         <property name="TABS" value="${PLUGIN_DIR}/tabs/tabs.js" />\r
23         <property name="TABS_PACK" value="${DIST_DIR}/jquery.tabs.pack.js" />\r
24 \r
25         <!-- MAIN -->\r
26 \r
27     <target name="jquery">
28         <echo message="Building ${JQ}" />
29         <mkdir dir="${DIST_DIR}" />
30         <concat destfile="${JQ}">\r
31                 <fileset dir="${SRC_DIR}" includes="intro.js" />
32             <fileset dir="${SRC_DIR}" includes="jquery/*.js" />
33             <fileset dir="${SRC_DIR}" includes="event/*.js" />
34             <fileset dir="${SRC_DIR}" includes="fx/*.js" />
35             <fileset dir="${SRC_DIR}" includes="ajax/*.js" />\r
36                 <fileset dir="${PLUGIN_DIR}" includes="${PLUGINS}" />\r
37                 <fileset dir="${SRC_DIR}" includes="outro.js" />
38         </concat>
39         <echo message="${JQ} built." />
40     </target>
41
42     <target name="lite" depends="jquery">
43         <echo message="Building ${JQ_LITE}" />
44         <java jar="${JAR}" fork="true">
45             <arg value="${BUILD_DIR}/build/lite.js" />
46             <arg value="${JQ}" />
47             <arg value="${JQ_LITE}" />
48         </java>
49         <echo message="${JQ_LITE} built." />
50     </target>
51
52     <target name="min" depends="jquery">
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">
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="test" depends="jquery">
73         <echo message="Building Test Suite" />
74         <delete dir="${TEST_DIR}" />
75         <mkdir dir="${TEST_DIR}/data" />\r
76         <copy todir="${TEST_DIR}/data">\r
77                 <fileset dir="${BUILD_DIR}/test/data/" />\r
78         </copy>\r
79         <java jar="${JAR}" fork="true">
80             <arg value="${BUILD_DIR}/test/test.js" />
81             <arg value="${JQ}" />
82             <arg value="${TEST_DIR}" />
83         </java>
84         <echo message="Test Suite built." />
85     </target>
86
87     <target name="docs" depends="jquery">
88         <echo message="Building Documentation" />
89         <delete dir="${DOCS_DIR}" />
90         <mkdir dir="${DOCS_DIR}/data" />
91         <copy todir="${DOCS_DIR}" file="${BUILD_DIR}/docs/.htaccess" />
92         <mkdir dir="${DOCS_DIR}/js" />
93         <copy todir="${DOCS_DIR}/js" >
94             <fileset dir="${BUILD_DIR}/docs/js">
95                 <include name="**/*.js"/>
96             </fileset>
97         </copy>
98                 <copy todir="${DOCS_DIR}/style" >
99             <fileset dir="${BUILD_DIR}/docs/style">
100                 <include name="**"/>
101             </fileset>
102         </copy>
103         <java jar="${JAR}" fork="true">
104             <arg value="${BUILD_DIR}/docs/docs.js" />
105             <arg value="${JQ}" />
106             <arg value="${DOCS_DIR}" />
107         </java>
108         <echo message="Documentation built." />
109     </target>
110
111     <target name="clean">
112         <delete dir="${DOCS_DIR}" />
113         <delete dir="${TEST_DIR}" />
114         <delete dir="${DIST_DIR}" />
115     </target>
116
117     <target name="all" depends="clean,jquery,lite,min,pack,docs,test" >
118         <echo message="Build complete." />
119     </target>\r
120 \r
121         <!-- PLUGINS -->\r
122 \r
123         <target name="ifx" description="Build jquery with Interface fx plugins">\r
124                 <antcall target="jquery">\r
125                         <param name="PLUGINS" value="interface/ifx*.js" />\r
126                 </antcall>\r
127         </target>\r
128 \r
129         <target name="cookieFormPager" description="Build jquery with cookie, form and pager plugins">\r
130                 <antcall target="jquery">\r
131                         <param name="PLUGINS" value="cookie/*.js,form/*.js,pager/*.js" />\r
132                 </antcall>\r
133         </target>\r
134 \r
135         <target name="pack_tabs">\r
136         <echo message="Building ${TABS_PACK}" />\r
137         <java jar="${JAR}" fork="true">\r
138             <arg value="${BUILD_DIR}/build/pack.js" />\r
139             <arg value="${TABS}" />\r
140             <arg value="${TABS_PACK}" />\r
141         </java>\r
142         <echo message="${TABS_PACK} built." />\r
143     </target>\r
144
145 </project>