2010-04-08 01:38:19 +00:00
|
|
|
<project name="jQuery" default="all" basedir=".">
|
2007-01-25 14:06:43 +00:00
|
|
|
|
2009-01-18 13:04:32 +00:00
|
|
|
<loadfile property="version" srcfile="version.txt" />
|
2010-04-08 01:38:19 +00:00
|
|
|
<property name="PREFIX" value="." />
|
|
|
|
<property description="Folder for jquery and min target" name="dist" value="${PREFIX}/dist" />
|
2010-04-08 01:20:35 +00:00
|
|
|
|
|
|
|
<property name="JQ" value="${dist}/jquery.js" />
|
|
|
|
<property name="JQ_MIN" value="${dist}/jquery.min.js" />
|
2009-12-08 21:22:49 +00:00
|
|
|
|
2009-12-08 21:03:22 +00:00
|
|
|
<loadfile property="sizzle-exports" srcfile="src/sizzle-jquery.js" />
|
2010-04-08 01:38:19 +00:00
|
|
|
|
2009-12-08 21:03:22 +00:00
|
|
|
<available property="qunit" file="test/qunit" />
|
|
|
|
<available property="sizzle" file="src/sizzle" />
|
2010-04-08 01:20:35 +00:00
|
|
|
|
2010-04-08 01:38:19 +00:00
|
|
|
<target name="all" depends="jquery,lint,min" />
|
|
|
|
|
2009-12-08 21:03:22 +00:00
|
|
|
<target name="qunit-clone" unless="qunit">
|
2010-04-08 01:20:35 +00:00
|
|
|
<exec executable="git" outputproperty="git-qunit" >
|
2010-04-08 01:38:19 +00:00
|
|
|
<arg line="clone git://github.com/jquery/qunit.git test/qunit" />
|
2009-12-08 21:03:22 +00:00
|
|
|
</exec>
|
|
|
|
<echo message="git clone qunit: ${git-qunit}" />
|
|
|
|
</target>
|
|
|
|
<target name="qunit-pull" if="qunit">
|
2010-04-08 01:20:35 +00:00
|
|
|
<exec executable="git" outputproperty="git-qunit" dir="test/qunit" >
|
2010-04-08 01:38:19 +00:00
|
|
|
<arg line="pull origin master" />
|
2010-04-08 01:20:35 +00:00
|
|
|
</exec>
|
2009-12-08 21:03:22 +00:00
|
|
|
<echo message="git pull sizzle: ${git-qunit}" />
|
|
|
|
</target>
|
|
|
|
<target name="sizzle-clone" unless="sizzle">
|
2010-04-08 01:20:35 +00:00
|
|
|
<exec executable="git" outputproperty="git-sizzle" >
|
2010-04-08 01:38:19 +00:00
|
|
|
<arg line="clone git://github.com/jeresig/sizzle.git src/sizzle" />
|
2010-04-08 01:20:35 +00:00
|
|
|
</exec>
|
2009-12-08 21:03:22 +00:00
|
|
|
<echo message="git clone sizzle: ${git-sizzle}" />
|
|
|
|
</target>
|
|
|
|
<target name="sizzle-pull" if="sizzle">
|
2010-04-08 01:20:35 +00:00
|
|
|
<exec executable="git" outputproperty="git-sizzle" dir="src/sizzle" >
|
2010-04-08 01:38:19 +00:00
|
|
|
<arg line="pull origin master" />
|
2010-04-08 01:20:35 +00:00
|
|
|
</exec>
|
2009-12-08 21:03:22 +00:00
|
|
|
<echo message="git pull sizzle: ${git-sizzle}" />
|
|
|
|
</target>
|
2007-01-25 14:06:43 +00:00
|
|
|
|
2010-04-08 01:38:19 +00:00
|
|
|
<target name="init" depends="qunit-clone,qunit-pull,sizzle-clone,sizzle-pull" />
|
|
|
|
|
|
|
|
<target name="selector" depends="init" description="Builds the selector library for jQuery from Sizzle.">
|
2010-04-08 01:20:35 +00:00
|
|
|
<copy file="src/sizzle/sizzle.js" tofile="src/selector.js" overwrite="true" />
|
2010-04-08 01:38:19 +00:00
|
|
|
<replaceregexp match="// EXPOSE(.*) " replace="// EXPOSE\1 ${sizzle-exports}" file="src/selector.js" />
|
|
|
|
<replaceregexp match="window.Sizzle(.*) " replace="" file="src/selector.js" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="jquery" depends="init,selector" description="Main jquery build, concatenates source files and replaces @VERSION">
|
|
|
|
<echo message="Building ${JQ}" />
|
2010-04-08 01:20:35 +00:00
|
|
|
<mkdir dir="${dist}" />
|
|
|
|
<concat destfile="${JQ}">
|
|
|
|
<fileset file="src/intro.js" />
|
|
|
|
<fileset file="src/core.js" />
|
|
|
|
<fileset file="src/support.js" />
|
|
|
|
<fileset file="src/data.js" />
|
|
|
|
<fileset file="src/queue.js" />
|
|
|
|
<fileset file="src/attributes.js" />
|
|
|
|
<fileset file="src/event.js" />
|
|
|
|
<fileset file="src/selector.js" />
|
|
|
|
<fileset file="src/traversing.js" />
|
|
|
|
<fileset file="src/manipulation.js" />
|
|
|
|
<fileset file="src/css.js" />
|
|
|
|
<fileset file="src/ajax.js" />
|
2011-01-06 00:17:31 +00:00
|
|
|
<fileset file="src/ajax/jsonp.js" />
|
|
|
|
<fileset file="src/ajax/script.js" />
|
|
|
|
<fileset file="src/ajax/xhr.js" />
|
2010-04-08 01:20:35 +00:00
|
|
|
<fileset file="src/effects.js" />
|
|
|
|
<fileset file="src/offset.js" />
|
|
|
|
<fileset file="src/dimensions.js" />
|
|
|
|
<fileset file="src/outro.js" />
|
|
|
|
</concat>
|
|
|
|
<replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${JQ}" />
|
2010-04-08 01:06:46 +00:00
|
|
|
<exec executable="git" outputproperty="date">
|
2010-04-08 01:38:19 +00:00
|
|
|
<arg line="log -1 --pretty=format:%ad" />
|
2010-04-08 01:06:46 +00:00
|
|
|
</exec>
|
2010-12-11 00:56:29 +00:00
|
|
|
<replaceregexp match="(\(\s*function\s*\(\s*jQuery\s*\)\s*\{)|(\}\s*\)\s*\(\s*jQuery\s*\)\s*;)" flags="g" replace="" file="${JQ}" />
|
2010-12-30 06:34:48 +00:00
|
|
|
<replaceregexp match="@DATE" replace="${date}" file="${JQ}" />
|
2010-04-08 01:20:35 +00:00
|
|
|
<echo message="${JQ} built." />
|
|
|
|
</target>
|
2007-01-25 14:06:43 +00:00
|
|
|
|
2010-04-08 01:38:19 +00:00
|
|
|
<target name="lint" depends="jquery" description="Check jQuery against JSLint">
|
|
|
|
<exec executable="java">
|
|
|
|
<arg line="-jar build/js.jar build/jslint-check.js" />
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
2010-04-08 01:20:35 +00:00
|
|
|
<target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
|
|
|
|
<echo message="Building ${JQ_MIN}" />
|
2009-12-08 21:22:49 +00:00
|
|
|
<apply executable="java" parallel="false" verbose="true" dest="${dist}">
|
|
|
|
<fileset dir="${dist}">
|
2009-01-04 17:21:00 +00:00
|
|
|
<include name="jquery.js" />
|
|
|
|
</fileset>
|
|
|
|
<arg line="-jar" />
|
2010-10-14 20:57:12 +00:00
|
|
|
<arg path="build/google-compiler-20100917.jar" />
|
2009-12-19 02:23:26 +00:00
|
|
|
<arg value="--warning_level" />
|
|
|
|
<arg value="QUIET" />
|
|
|
|
<arg value="--js_output_file" />
|
2009-01-04 17:21:00 +00:00
|
|
|
<targetfile />
|
2009-12-19 02:23:26 +00:00
|
|
|
<arg value="--js" />
|
|
|
|
<mapper type="glob" from="jquery.js" to="tmpmin" />
|
2009-01-04 17:21:00 +00:00
|
|
|
</apply>
|
2009-12-19 02:23:26 +00:00
|
|
|
<concat destfile="${JQ_MIN}">
|
2010-04-08 01:38:19 +00:00
|
|
|
<filelist files="${JQ}, ${dist}/tmpmin" />
|
2009-12-19 02:23:26 +00:00
|
|
|
<filterchain>
|
2010-04-08 01:38:19 +00:00
|
|
|
<headfilter lines="15" />
|
2009-12-19 02:23:26 +00:00
|
|
|
</filterchain>
|
|
|
|
</concat>
|
|
|
|
<concat destfile="${JQ_MIN}" append="yes">
|
2010-04-08 01:38:19 +00:00
|
|
|
<filelist files="${dist}/tmpmin" />
|
2009-12-19 02:23:26 +00:00
|
|
|
</concat>
|
2010-04-08 01:38:19 +00:00
|
|
|
<delete file="${dist}/tmpmin" />
|
2010-04-08 01:20:35 +00:00
|
|
|
<echo message="${JQ_MIN} built." />
|
|
|
|
</target>
|
2007-01-25 14:06:43 +00:00
|
|
|
|
2010-04-08 01:20:35 +00:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="${dist}" />
|
2010-04-08 01:38:19 +00:00
|
|
|
<delete file="src/selector.js" />
|
|
|
|
<delete dir="test/qunit" />
|
|
|
|
<delete dir="src/sizzle" />
|
2010-04-08 01:20:35 +00:00
|
|
|
</target>
|
2007-01-25 14:06:43 +00:00
|
|
|
|
2009-01-14 22:43:55 +00:00
|
|
|
<target name="openAjaxMetadata">
|
|
|
|
<property name="target" value="openAjaxMetadata-jquery-${version}.xml" />
|
2010-04-08 01:38:19 +00:00
|
|
|
<delete file="${dist}/jquery-*.xml" />
|
2009-01-14 22:43:55 +00:00
|
|
|
<get src="http://www.exfer.net/jquery/createjQueryXMLDocs.py?version=1.3" dest="${target}" />
|
|
|
|
<xslt includes="${target}" excludes="build.xml" destdir="./dist" style="build/style.xsl" extension=".xml" />
|
|
|
|
<delete file="${target}" />
|
|
|
|
</target>
|
2006-08-16 21:14:03 +00:00
|
|
|
|
|
|
|
</project>
|