1 <project name="jQuery" default="all" basedir=".">
3 <loadfile property="version" srcfile="version.txt" />
4 <property name="PREFIX" value="." />
5 <property description="Folder for jquery and min target" name="dist" value="${PREFIX}/dist" />
7 <property name="JQ" value="${dist}/jquery.js" />
8 <property name="JQ_MIN" value="${dist}/jquery.min.js" />
10 <loadfile property="sizzle-exports" srcfile="src/sizzle-jquery.js" />
12 <available property="qunit" file="test/qunit" />
13 <available property="sizzle" file="src/sizzle" />
15 <target name="all" depends="jquery,lint,min" />
17 <target name="qunit-clone" unless="qunit">
18 <exec executable="git" outputproperty="git-qunit" >
19 <arg line="clone git://github.com/jquery/qunit.git test/qunit" />
21 <echo message="git clone qunit: ${git-qunit}" />
23 <target name="qunit-pull" if="qunit">
24 <exec executable="git" outputproperty="git-qunit" dir="test/qunit" >
25 <arg line="pull origin master" />
27 <echo message="git pull sizzle: ${git-qunit}" />
29 <target name="sizzle-clone" unless="sizzle">
30 <exec executable="git" outputproperty="git-sizzle" >
31 <arg line="clone git://github.com/jeresig/sizzle.git src/sizzle" />
33 <echo message="git clone sizzle: ${git-sizzle}" />
35 <target name="sizzle-pull" if="sizzle">
36 <exec executable="git" outputproperty="git-sizzle" dir="src/sizzle" >
37 <arg line="pull origin master" />
39 <echo message="git pull sizzle: ${git-sizzle}" />
42 <target name="init" depends="qunit-clone,qunit-pull,sizzle-clone,sizzle-pull" />
44 <target name="selector" depends="init" description="Builds the selector library for jQuery from Sizzle.">
45 <copy file="src/sizzle/sizzle.js" tofile="src/selector.js" overwrite="true" />
46 <replaceregexp match="// EXPOSE(.*) " replace="// EXPOSE\1 ${sizzle-exports}" file="src/selector.js" />
47 <replaceregexp match="window.Sizzle(.*) " replace="" file="src/selector.js" />
50 <target name="jquery" depends="init,selector" description="Main jquery build, concatenates source files and replaces @VERSION">
51 <echo message="Building ${JQ}" />
52 <mkdir dir="${dist}" />
53 <concat destfile="${JQ}">
54 <fileset file="src/intro.js" />
55 <fileset file="src/core.js" />
56 <fileset file="src/support.js" />
57 <fileset file="src/data.js" />
58 <fileset file="src/queue.js" />
59 <fileset file="src/attributes.js" />
60 <fileset file="src/event.js" />
61 <fileset file="src/selector.js" />
62 <fileset file="src/traversing.js" />
63 <fileset file="src/manipulation.js" />
64 <fileset file="src/css.js" />
65 <fileset file="src/ajax.js" />
66 <fileset file="src/effects.js" />
67 <fileset file="src/offset.js" />
68 <fileset file="src/dimensions.js" />
69 <fileset file="src/outro.js" />
71 <replaceregexp match="@VERSION" replace="${version}" flags="g" byline="true" file="${JQ}" />
72 <exec executable="git" outputproperty="date">
73 <arg line="log -1 --pretty=format:%ad" />
75 <replaceregexp match="Date: " replace="Date: ${date}" file="${JQ}" />
76 <echo message="${JQ} built." />
79 <target name="lint" depends="jquery" description="Check jQuery against JSLint">
80 <exec executable="java">
81 <arg line="-jar build/js.jar build/jslint-check.js" />
85 <target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
86 <echo message="Building ${JQ_MIN}" />
87 <apply executable="java" parallel="false" verbose="true" dest="${dist}">
88 <fileset dir="${dist}">
89 <include name="jquery.js" />
92 <arg path="build/google-compiler-20100917.jar" />
93 <arg value="--warning_level" />
95 <arg value="--js_output_file" />
98 <mapper type="glob" from="jquery.js" to="tmpmin" />
100 <concat destfile="${JQ_MIN}">
101 <filelist files="${JQ}, ${dist}/tmpmin" />
103 <headfilter lines="15" />
106 <concat destfile="${JQ_MIN}" append="yes">
107 <filelist files="${dist}/tmpmin" />
109 <delete file="${dist}/tmpmin" />
110 <echo message="${JQ_MIN} built." />
113 <target name="clean">
114 <delete dir="${dist}" />
115 <delete file="src/selector.js" />
116 <delete dir="test/qunit" />
117 <delete dir="src/sizzle" />
120 <target name="openAjaxMetadata">
121 <property name="target" value="openAjaxMetadata-jquery-${version}.xml" />
122 <delete file="${dist}/jquery-*.xml" />
123 <get src="http://www.exfer.net/jquery/createjQueryXMLDocs.py?version=1.3" dest="${target}" />
124 <xslt includes="${target}" excludes="build.xml" destdir="./dist" style="build/style.xsl" extension=".xml" />
125 <delete file="${target}" />