Further cleanup on ant build
[jquery.git] / build.xml
1 <project name="jQuery" default="jquery" basedir=".">
2
3     <property description="Source Folder" name="SRC_DIR" value="src"  />
4     <property description="Files for parsing etc." name="BUILD_DIR" value="build" />
5     <property description="YUICompressor" name="YUICompressor" value="${BUILD_DIR}/yuicompressor-2.4.2.jar" />
6         <loadfile description="Version to build" property="version" srcfile="version.txt" />
7
8     <property description="Folder for jquery, min, lite and packed target" name="DIST_DIR" value="./dist" />
9
10     <property name="JQ" value="${DIST_DIR}/jquery.js" />
11     <property name="JQ_LITE" value="${DIST_DIR}/jquery.lite.js" />
12     <property name="JQ_MIN" value="${DIST_DIR}/jquery.min.js" />
13     <property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />
14         <loadfile property="version" srcfile="version.txt" />
15
16     <target name="jquery" description="Main jquery build, concatenates source files and replaces @VERSION">
17         <echo message="Building ${JQ}" />
18         <mkdir dir="${DIST_DIR}" />
19         <concat destfile="${JQ}">
20             <fileset dir="${SRC_DIR}" includes="intro.js" />
21             <fileset dir="${SRC_DIR}" includes="core.js" />
22             <fileset dir="${SRC_DIR}" includes="support.js" />
23             <fileset dir="${SRC_DIR}" includes="data.js" />
24             <fileset dir="${SRC_DIR}" includes="queue.js" />
25             <fileset dir="${SRC_DIR}" includes="event.js" />
26             <fileset dir="${SRC_DIR}" includes="selector.js" />
27             <fileset dir="${SRC_DIR}" includes="traversing.js" />
28             <fileset dir="${SRC_DIR}" includes="attributes.js" />
29             <fileset dir="${SRC_DIR}" includes="manipulation.js" />
30             <fileset dir="${SRC_DIR}" includes="css.js" />
31             <fileset dir="${SRC_DIR}" includes="ajax.js" />
32             <fileset dir="${SRC_DIR}" includes="fx.js" />
33             <fileset dir="${SRC_DIR}" includes="offset.js" />
34             <fileset dir="${SRC_DIR}" includes="dimensions.js" />
35             <fileset dir="${SRC_DIR}" includes="outro.js" />
36         </concat>
37         <replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${JQ}" />
38                 <replaceregexp match="Date: " replace="Date: ${date}" file="${JQ}" />
39                 <replaceregexp match="Revision: " replace="Revision: ${revision}" file="${JQ}" />
40         <echo message="${JQ} built." />
41     </target>
42
43     <target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
44         <echo message="Building ${JQ_MIN}" />
45                 <apply executable="java" parallel="false" verbose="true" dest="${DIST_DIR}">
46                         <fileset dir="${DIST_DIR}">
47                                 <include name="jquery.js" />
48                         </fileset>
49                         <arg line="-jar" />
50                         <arg path="${YUICompressor}" />
51                         <arg value="--charset" />
52                         <arg value="ANSI" />
53                         <arg value="-o" />
54                         <targetfile />
55                         <mapper type="glob" from="jquery.js" to="jquery.min.js" />
56                 </apply>
57         <echo message="${JQ_MIN} built." />
58     </target>
59
60         <target name="runtest">
61                 <echo message="Running Automated Test Suite" />
62                 <java jar="${JAR}" fork="true">
63             <arg value="${BUILD_DIR}/runtest/test.js" />
64         </java>
65                 <echo message="Test Suite Finished" />
66         </target>
67
68     <target name="clean">
69         <delete dir="${DIST_DIR}" />
70     </target>
71
72         <target name="openAjaxMetadata">
73                 <property name="target" value="openAjaxMetadata-jquery-${version}.xml" />
74                 <delete file="dist/jquery-*.xml" />
75                 <get src="http://www.exfer.net/jquery/createjQueryXMLDocs.py?version=1.3" dest="${target}" />
76                 <xslt includes="${target}" excludes="build.xml" destdir="./dist" style="build/style.xsl" extension=".xml" />
77                 <delete file="${target}" />
78         </target>
79
80 </project>