-<project name="jQuery" default="all" basedir=".">\r
- \r
- <!-- SETUP -->
+<project name="jQuery" default="jquery" basedir=".">
- <property name="SRC_DIR" value="src" />
- <property name="BUILD_DIR" value="build" />
- <property name="JAR" value="${BUILD_DIR}/js.jar" />\r
- \r
- <property name="PLUGIN_DIR" location="../plugins" />
+ <!--
+ To get jQuery even smaller, remove the modules you don't need by removing the fileset elements
+ in the jquery-target, for example leaving only these:
- <property name="PREFIX" value="." />
- <property name="DOCS_DIR" value="${PREFIX}/docs" />
- <property name="TEST_DIR" value="${PREFIX}/test" />
- <property name="DIST_DIR" value="${PREFIX}/dist" />
+ <fileset dir="${SRC_DIR}" includes="intro.js" />
+ <fileset dir="${SRC_DIR}" includes="core.js" />
+ <fileset dir="${SRC_DIR}" includes="selector.js" />
+ <fileset dir="${SRC_DIR}" includes="event.js" />
+ <fileset dir="${SRC_DIR}" includes="outro.js" />
+ That'd remove ajax, fx and offset support, leaving basic selectors, manipulation and event handling.
+ -->
+
+ <!-- SETUP -->
+
+ <property description="Source Folder" name="SRC_DIR" value="src" />
+ <property description="Files for parsing etc." name="BUILD_DIR" value="build" />
+ <property description="Rhino JS Engine" name="JAR" value="${BUILD_DIR}/js.jar" />
+
+ <property description="Folder for jquery, min, lite and packed target" name="DIST_DIR" value="./dist" />
+
+ <!-- Files names for distribution -->
<property name="JQ" value="${DIST_DIR}/jquery.js" />
<property name="JQ_LITE" value="${DIST_DIR}/jquery.lite.js" />
<property name="JQ_MIN" value="${DIST_DIR}/jquery.min.js" />
- <property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />\r
- <property name="JQ_TEMP" value="${DIST_DIR}/jquery.js.tmp" />
-\r
- <!-- MAIN -->\r
- \r
- <target name="jquery">
+ <property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />
+
+ <!-- MAIN -->
+
+ <target name="jquery" description="Main jquery build, concatenates source files and replaces @VERSION">
<echo message="Building ${JQ}" />
<mkdir dir="${DIST_DIR}" />
- <concat destfile="${JQ}">\r
- <fileset dir="${SRC_DIR}" includes="intro.js" />
- <fileset dir="${SRC_DIR}" includes="jquery/*.js" />
- <fileset dir="${SRC_DIR}" includes="event/*.js" />
- <fileset dir="${SRC_DIR}" includes="fx/*.js" />
- <fileset dir="${SRC_DIR}" includes="ajax/*.js" />\r
- <fileset dir="${SRC_DIR}" includes="outro.js" />
+ <concat destfile="${JQ}">
+ <fileset dir="${SRC_DIR}" includes="intro.js" />
+ <fileset dir="${SRC_DIR}" includes="core.js" />
+ <fileset dir="${SRC_DIR}" includes="selector.js" />
+ <fileset dir="${SRC_DIR}" includes="event.js" />
+ <fileset dir="${SRC_DIR}" includes="ajax.js" />
+ <fileset dir="${SRC_DIR}" includes="fx.js" />
+ <fileset dir="${SRC_DIR}" includes="offset.js" />
+ <fileset dir="${SRC_DIR}" includes="dimensions.js" />
+ <fileset dir="${SRC_DIR}" includes="outro.js" />
</concat>
- <echo message="${JQ} built." />
- </target>
-
- <target name="lite" depends="jquery">
- <echo message="Building ${JQ_LITE}" />
- <java jar="${JAR}" fork="true">
- <arg value="${BUILD_DIR}/build/lite.js" />
+ <java jar="${JAR}" fork="true">
+ <arg value="${BUILD_DIR}/build/version.js" />
<arg value="${JQ}" />
- <arg value="${JQ_LITE}" />
</java>
- <echo message="${JQ_LITE} built." />
+ <echo message="${JQ} built." />
</target>
- <target name="min" depends="jquery">
+ <target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building ${JQ_MIN}" />
<java jar="${JAR}" fork="true">
<arg value="${BUILD_DIR}/build/min.js" />
<echo message="${JQ_MIN} built." />
</target>
- <target name="pack" depends="jquery">
+ <target name="pack" depends="jquery" description="Remove all comments and whitespace and compress">
<echo message="Building ${JQ_PACK}" />
<java jar="${JAR}" fork="true">
<arg value="${BUILD_DIR}/build/pack.js" />
<echo message="${JQ_PACK} built." />
</target>
- <target name="test" depends="jquery">
- <echo message="Building Test Suite" />
- <delete dir="${TEST_DIR}" />
- <mkdir dir="${TEST_DIR}/data" />\r
- <copy todir="${TEST_DIR}/data">\r
- <fileset dir="${BUILD_DIR}/test/data/" />\r
- </copy>\r
- <java jar="${JAR}" fork="true">
- <arg value="${BUILD_DIR}/test/test.js" />
- <arg value="${JQ}" />
- <arg value="${TEST_DIR}" />
+ <target name="runtest">
+ <echo message="Running Automated Test Suite" />
+ <java jar="${JAR}" fork="true">
+ <arg value="${BUILD_DIR}/runtest/test.js" />
</java>
- <echo message="Test Suite built." />
- </target>
-
- <target name="docs" depends="jquery">
- <echo message="Building Documentation" />
- <delete dir="${DOCS_DIR}" />
- <mkdir dir="${DOCS_DIR}/data" />
- <copy todir="${DOCS_DIR}" file="${BUILD_DIR}/docs/.htaccess" />
- <mkdir dir="${DOCS_DIR}/js" />
- <copy todir="${DOCS_DIR}/js" >
- <fileset dir="${BUILD_DIR}/docs/js">
- <include name="**/*.js"/>
- </fileset>
- </copy>
- <copy todir="${DOCS_DIR}/style" >
- <fileset dir="${BUILD_DIR}/docs/style">
- <include name="**"/>
- </fileset>
- </copy>
- <java jar="${JAR}" fork="true">
- <arg value="${BUILD_DIR}/docs/docs.js" />
- <arg value="${JQ}" />
- <arg value="${DOCS_DIR}" />
- </java>
- <echo message="Documentation built." />
- </target>
+ <echo message="Test Suite Finished" />
+ </target>
<target name="clean">
- <delete dir="${DOCS_DIR}" />
- <delete dir="${TEST_DIR}" />
<delete dir="${DIST_DIR}" />
</target>
- <target name="all" depends="clean,jquery,lite,min,pack,docs,test" >
+ <target name="all" depends="clean,jquery,min,pack">
<echo message="Build complete." />
- </target>\r
- \r
- <!-- PLUGINS -->\r
- \r
- <target name="ifx" description="Build jquery with Interface fx plugins">\r
- <antcall target="plugin">\r
- <param name="plugins" value="interface/ifx*.js" />\r
- </antcall>\r
- </target>\r
- \r
- <target name="plugindocs" description="Build documentation for a set of plugins - Not working, yet">\r
- <antcall target="raw">\r
- <param name="plugins" value="center/*.js, cookie/*.js, form/*.js" />\r
- </antcall>\r
- <antcall target="docs" />\r
- </target>\r
- \r
- <target name="raw" description="Build a set of plugins, without jquery itself">\r
- <concat destfile="${JQ}">\r
- <fileset dir="${PLUGIN_DIR}" includes="${plugins}" />\r
- </concat>\r
- <echo message="${plugins} built." />\r
- </target>\r
- \r
- <target name="plugin" depends="jquery" description="Build jquery with a given set of plugins, see ifx target for an example">\r
- <copy tofile="${JQ_TEMP}" file="${JQ}"/>\r
- <concat destfile="${JQ}">\r
- <fileset file="${JQ_TEMP}" />\r
- <fileset dir="${PLUGIN_DIR}" includes="${plugins}" />\r
- </concat>\r
- <delete file="${JQ_TEMP}" />\r
- <echo message="${JQ} with ${plugins} built." />\r
- </target>
+ </target>
</project>