Added targets to allow building jquery with plugins; Creating the raw source files...
[jquery.git] / build.xml
index 839214f..4a598ea 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,8 +1,12 @@
-<project name="jQuery" default="all" basedir=".">
+<project name="jQuery" default="all" basedir=".">\r
+       \r
+       <!-- SETUP -->
 
     <property name="SRC_DIR" value="src" />
     <property name="BUILD_DIR" value="build" />
-    <property name="JAR" value="${BUILD_DIR}/js.jar" />
+    <property name="JAR" value="${BUILD_DIR}/js.jar" />\r
+       \r
+       <property name="PLUGIN_DIR" location="../plugins" />
 
     <property name="PREFIX" value="." />
     <property name="DOCS_DIR" value="${PREFIX}/docs" />
     <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" />
-
+    <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">
         <echo message="Building ${JQ}" />
         <mkdir dir="${DIST_DIR}" />
     <target name="test" depends="jquery">
         <echo message="Building Test Suite" />
         <delete dir="${TEST_DIR}" />
-        <mkdir dir="${TEST_DIR}/tests" />
-        <mkdir dir="${TEST_DIR}/js" />\r
-       <copy todir="${TEST_DIR}" file="${BUILD_DIR}/test/index.html" />
-        <copy todir="${TEST_DIR}/js">
-            <fileset dir="${BUILD_DIR}/test/js">
-                <include name="**/*.js"/>
-            </fileset>
-        </copy>
-
+       <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}" />
@@ -82,6 +84,7 @@
         <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">
 
     <target name="all" depends="clean,jquery,lite,min,pack,docs,test" >
         <echo message="Build complete." />
-    </target>
+    </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>
 
 </project>