Added accordion to PLUGINS_ALL
[jquery.git] / build.xml
1 <project name="jQuery" default="all" basedir=".">
2         
3         <!--
4         - Using this build file to create your own custom distribution -
5         
6         If you want to include jQuery on your site with a certain set of plugins,
7         follow these steps to create your custom build:
8         
9         1. Copy the plugins you need to the plugins folder (if you haven't already, checkout
10            the plugins folder from SVN.
11         2. Modify the PLUGINS property to include all plugins you want, see PLUGINS_ALL for syntax
12            eg. if you need form and tabs plugin, set the value for PLUGINS to this:
13            form/*.js, tabs/*.js
14         3. Execute the standard jquery and packed targets to build your distribution
15
16         TODO Using this build file to create docs for a single plugin
17         -->\r
18 \r
19         <!-- SETUP -->
20
21         <property description="Source Folder" name="SRC_DIR" value="src" />
22         <property description="Files for parsing etc." name="BUILD_DIR" value="build" />
23         <property description="Rhino JS Engine" name="JAR" value="${BUILD_DIR}/js.jar" />\r
24 \r
25         <property description="Dir to look for plugins" name="PLUGIN_DIR" location="../plugins" />\r
26         <property description="Add single plugins here" name="PLUGINS" value="none" />
27         <property description="Add all plugins here" name="PLUGINS_ALL" 
28                 value="button/*.js,center/*.js,cookie/*.js,form/*.js,greybox/*.js,interface/*.js,pager/*.js,tablesorter/*.js,tabs/*.js,tooltip/*.js,accordion/*.jw" />\r
29
30         <property description="Target parent folder for built files" name="PREFIX" value="." />
31         <property description="Folder for docs target" name="DOCS_DIR" value="${PREFIX}/docs" />
32         <property description="Folder for test target" name="TEST_DIR" value="${PREFIX}/test" />
33         <property description="Folder for jquery, min, lite and packed target" name="DIST_DIR" value="${PREFIX}/dist" />
34
35         <!-- Files names for distribution -->
36         <property name="JQ" value="${DIST_DIR}/jquery.js" />
37         <property name="JQ_LITE" value="${DIST_DIR}/jquery.lite.js" />
38         <property name="JQ_MIN" value="${DIST_DIR}/jquery.min.js" />
39         <property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />\r
40 \r
41         <!-- MAIN -->\r
42 \r
43         <target name="jquery" description="Main jquery build, set PLUGINS property to include plugins">
44                 <echo message="Building ${JQ}" />
45                 <mkdir dir="${DIST_DIR}" />
46                 <concat destfile="${JQ}">\r
47                         <fileset dir="${SRC_DIR}" includes="intro.js" />
48                         <fileset dir="${SRC_DIR}" includes="jquery/*.js" />
49                         <fileset dir="${SRC_DIR}" includes="event/*.js" />
50                         <fileset dir="${SRC_DIR}" includes="fx/*.js" />
51                         <fileset dir="${SRC_DIR}" includes="ajax/*.js" />\r
52                         <fileset dir="${PLUGIN_DIR}" includes="${PLUGINS}" />\r
53                         <fileset dir="${SRC_DIR}" includes="outro.js" />
54                 </concat>
55                 <echo message="${JQ} built." />
56         </target>
57
58         <target name="jquery_with_plugins" description="Build jquery with all plugins, useful to full documentation">
59                 <antcall target="jquery">
60                         <param name="PLUGINS" value="${PLUGINS_ALL}" />
61                 </antcall>\r
62         </target>
63
64         <target name="lite" depends="jquery" description="Remove all /** */ comments">
65                 <echo message="Building ${JQ_LITE}" />
66                 <java jar="${JAR}" fork="true">
67                         <arg value="${BUILD_DIR}/build/lite.js" />
68                         <arg value="${JQ}" />
69                         <arg value="${JQ_LITE}" />
70                 </java>
71                 <echo message="${JQ_LITE} built." />
72         </target>
73
74         <target name="min" depends="jquery" description="Remove all comments and whitespace, no compression">
75                 <echo message="Building ${JQ_MIN}" />
76                 <java jar="${JAR}" fork="true">
77                         <arg value="${BUILD_DIR}/build/min.js" />
78                         <arg value="${JQ}" />
79                         <arg value="${JQ_MIN}" />
80                 </java>
81                 <echo message="${JQ_MIN} built." />
82         </target>
83
84         <target name="pack" depends="jquery" description="Remove all comments and whitespace and compress">
85                 <echo message="Building ${JQ_PACK}" />
86                 <java jar="${JAR}" fork="true">
87                         <arg value="${BUILD_DIR}/build/pack.js" />
88                         <arg value="${JQ}" />
89                         <arg value="${JQ_PACK}" />
90                 </java>
91                 <echo message="${JQ_PACK} built." />
92         </target>\r
93 \r
94         <target name="pack_with_plugins" depends="jquery_with_plugins" description="Pack jquery with all plugins, not very useful">\r
95                 <echo message="Building ${JQ_PACK}" />\r
96                 <java jar="${JAR}" fork="true">\r
97                         <arg value="${BUILD_DIR}/build/pack.js" />\r
98                         <arg value="${JQ}" />\r
99                         <arg value="${JQ_PACK}" />\r
100                 </java>\r
101                 <echo message="${JQ_PACK} built." />\r
102         </target>
103
104         <target name="test" depends="jquery" description="Reads tests from source and compiles into html file, testsuite must be run on a webserver">
105                 <echo message="Building Test Suite" />
106                 <delete dir="${TEST_DIR}" />
107                 <mkdir dir="${TEST_DIR}/data" />\r
108                 <copy todir="${TEST_DIR}/data">\r
109                         <fileset dir="${BUILD_DIR}/test/data/" />\r
110                 </copy>\r
111                 <java jar="${JAR}" fork="true">
112                         <arg value="${BUILD_DIR}/test/test.js" />
113                         <arg value="${JQ}" />
114                         <arg value="${TEST_DIR}" />
115                 </java>
116                 <echo message="Test Suite built." />
117         </target>
118
119         <target name="docs" depends="jquery" description="Reads inline docs from source and compiles into xml file">
120                 <echo message="Building Documentation" />
121                 <delete dir="${DOCS_DIR}" />
122                 <mkdir dir="${DOCS_DIR}/data" />
123                 <copy todir="${DOCS_DIR}" file="${BUILD_DIR}/docs/.htaccess" />
124                 <mkdir dir="${DOCS_DIR}/js" />
125                 <copy todir="${DOCS_DIR}/js">
126                         <fileset dir="${BUILD_DIR}/docs/js">
127                                 <include name="**/*.js" />
128                         </fileset>
129                 </copy>
130                 <copy todir="${DOCS_DIR}/style">
131                         <fileset dir="${BUILD_DIR}/docs/style">
132                                 <include name="**" />
133                         </fileset>
134                 </copy>
135                 <java jar="${JAR}" fork="true">
136                         <arg value="${BUILD_DIR}/docs/docs.js" />
137                         <arg value="${JQ}" />
138                         <arg value="${DOCS_DIR}" />
139                 </java>
140                 <echo message="Documentation built." />
141         </target>\r
142
143         <!-- TODO refactor to remove duplication with above -->\r
144         <target name="docs_with_plugins" depends="jquery_with_plugins">\r
145                 <echo message="Building Documentation" />\r
146                 <delete dir="${DOCS_DIR}" />\r
147                 <mkdir dir="${DOCS_DIR}/data" />\r
148                 <copy todir="${DOCS_DIR}" file="${BUILD_DIR}/docs/.htaccess" />\r
149                 <mkdir dir="${DOCS_DIR}/js" />\r
150                 <copy todir="${DOCS_DIR}/js">\r
151                         <fileset dir="${BUILD_DIR}/docs/js">\r
152                                 <include name="**/*.js" />\r
153                         </fileset>\r
154                 </copy>\r
155                 <copy todir="${DOCS_DIR}/style">\r
156                         <fileset dir="${BUILD_DIR}/docs/style">\r
157                                 <include name="**" />\r
158                         </fileset>\r
159                 </copy>\r
160                 <java jar="${JAR}" fork="true">\r
161                         <arg value="${BUILD_DIR}/docs/docs.js" />\r
162                         <arg value="${JQ}" />\r
163                         <arg value="${DOCS_DIR}" />\r
164                 </java>\r
165                 <echo message="Documentation built." />\r
166         </target>
167
168         <target name="clean">
169                 <delete dir="${DOCS_DIR}" />
170                 <delete dir="${TEST_DIR}" />
171                 <delete dir="${DIST_DIR}" />
172         </target>
173
174         <target name="all" depends="clean,jquery,lite,min,pack,docs,test">
175                 <echo message="Build complete." />
176         </target>
177         
178         <!-- Extra stuff for Tabs plugin -->
179         
180         <property name="TABS" value="${PLUGIN_DIR}/tabs/tabs.js" />
181         <property name="TABS_PACK" value="${DIST_DIR}/jquery.tabs.pack.js" />
182
183         <target name="pack_tabs">\r
184                 <echo message="Building ${TABS_PACK}" />\r
185                 <mkdir dir="${DIST_DIR}" />\r
186                 <java jar="${JAR}" fork="true">\r
187                         <arg value="${BUILD_DIR}/build/pack.js" />\r
188                         <arg value="${TABS}" />\r
189                         <arg value="${TABS_PACK}" />\r
190                 </java>\r
191                 <echo message="${TABS_PACK} built." />\r
192         </target>\r
193
194 </project>