|
8 | 8 | srcroot |
9 | 9 | projpath |
10 | 10 | public_javadoc_dir |
11 | | - |
12 | | - These are optional: |
13 | | - compile-from |
14 | | - compile-to |
15 | 11 |
|
16 | 12 | Assumes these targets exist: |
17 | 13 | stable |
18 | 14 | development |
| 15 | + jar |
19 | 16 | |
20 | 17 | --> |
21 | 18 | <!-- <taskdef name="javamake" classname="com.sun.tools.javamake.ant.JavaMake"/> --> |
22 | 19 |
|
23 | | -<property name="compile-from" value="${srcroot}" /> |
24 | | -<property name="compile-to" value="${built}" /> |
25 | | - |
26 | 20 | <property name="build.sysclasspath" value="last" /> |
27 | 21 |
|
28 | 22 | <property name="lib_dir" value="${srcroot}/edu/rice/cs/lib" /> |
29 | 23 |
|
| 24 | +<property name="jsr14_classpath" value="${lib_dir}/jsr14.jar" /> |
| 25 | +<property name="jsr14_collect_classpath" value="${lib_dir}/collect.jar" /> |
| 26 | + |
30 | 27 | <property name="jars_dir" value="/home/javaplt/public_html/drjava/builds" /> |
31 | 28 |
|
32 | 29 | <!-- put javadoc in this directory if generating private javadoc --> |
|
44 | 41 |
|
45 | 42 | <!-- classpath to use everywhere. --> |
46 | 43 | <path id="classpath"> |
47 | | - |
| 44 | + <pathelement location="${jsr14_classpath}" /> |
48 | 45 | <!-- <pathelement path="${java.class.path}" /> --> |
49 | 46 | <fileset dir="${lib_dir}"> |
50 | 47 | <include name="*.jar" /> |
51 | | - <exclude name="jsr14.jar" /> |
52 | | - <exclude name="collect.jar" /> |
53 | 48 | </fileset> |
54 | 49 | <pathelement path="${built}" /> |
55 | 50 | </path> |
56 | 51 |
|
57 | 52 | <!-- Init target. All others depend on it. Initialize the directory. --> |
58 | 53 | <target name="init"> |
59 | | - <available type="file" file="${jsr14_classpath}" property="jsr14_ok" /> |
60 | | - <!--antcall target="check_for_jsr14" /--> |
| 54 | + <!-- <available type="file" file="${jsr14_classpath}" property="jsr14_ok" /> |
| 55 | + <antcall target="check_for_jsr14" /> --> |
61 | 56 | <mkdir dir="${built}" /> <!-- Make the built directory --> |
62 | 57 |
|
63 | 58 | <pathconvert refid="classpath" |
|
66 | 61 |
|
67 | 62 | </target> |
68 | 63 |
|
69 | | - |
70 | 64 | <!-- Get a timestamp based on GMT, rather than local time --> |
71 | 65 | <target name="get-timestamp"> |
72 | 66 | <tstamp> |
73 | | - <format property="DSTAMP" pattern="yyyyMMdd" timezone="GMT" /> |
74 | | - <format property="TSTAMP" pattern="HHmm" timezone="GMT" /> |
75 | | - <format property="TODAY" pattern="MMMM dd yyyy" timezone="GMT" /> |
| 67 | + <format property="DSTAMP" pattern="yyyyMMdd" timezone="GMT" /> |
| 68 | + <format property="TSTAMP" pattern="HHmm" timezone="GMT" /> |
| 69 | + <format property="TODAY" pattern="MMMM dd yyyy" timezone="GMT" /> |
76 | 70 | </tstamp> |
77 | 71 | </target> |
78 | | - |
79 | | - |
| 72 | + |
| 73 | +<target name="check_for_jsr14" unless="jsr14_ok"> |
| 74 | + <fail message=" JSR-14 prototype compiler was not found. A jar file containing the compiler must be put in ${lib_dir}/jsr14.jar. (We can not distribute the jar for licensing reasons.) To download jsr14, go to http://developer.java.sun.com/developer/earlyAccess/adding_generics. Then unzip the file you downloaded, and move the included javac.jar (or gjc-rt.jar) to lib/jsr14.jar." /> |
| 75 | +</target> |
80 | 76 |
|
81 | 77 | <!-- Reconcile source with CVS archive --> |
82 | 78 | <target name="update" depends="init"> |
83 | | - <cvs command="update -d -P" compression="true" /> |
| 79 | + <cvs command="update -d -P" /> |
84 | 80 | </target> |
85 | 81 |
|
86 | 82 | <target name="make-version-stamp" depends="get-timestamp"> |
| 83 | + <tstamp_gmt /> <!-- get new time stamp to use for CVS tag --> |
| 84 | + |
87 | 85 | <!-- Create new Version.java, filling in date and time. --> |
88 | 86 | <filter token="DATE" value="${DSTAMP}" /> |
89 | 87 | <filter token="TIME" value="${TSTAMP}" /> |
|
98 | 96 | <!-- Commit source to CVS archive |
99 | 97 | Before doing do, we update our copy with the CVS copy. This ensures that |
100 | 98 | if there were any clashes, we have to resolve them now. Then we |
101 | | - recompile (from scratch) and retest. If this all succeeds, we can commit. |
| 99 | + recompile (from scratch), create a jar file, and retest. If this all succeeds, we can commit. |
102 | 100 |
|
103 | 101 | After committing, we tag the build we just made with the tag |
104 | 102 | projectname-date-time. |
105 | 103 | --> |
106 | | -<target name="do-commit" depends="clean, update, test, make-version-stamp, get-timestamp"> |
| 104 | +<target name="do-commit" depends="clean, update, jar, test, make-version-stamp, get-timestamp"> |
107 | 105 | <property name="version-tag" |
108 | 106 | value="${ant.project.name}-${DSTAMP}-${TSTAMP}" /> |
109 | 107 |
|
110 | 108 | <!-- recompile to make new version number get into code. --> |
111 | 109 | <echo message="All tests passed. Rebuilding to put version tag (${version-tag}) into the code." /> |
112 | 110 | <antcall target="compile" /> |
113 | 111 |
|
| 112 | + <!-- Remind user to commit the new dynamicjar.jar file. --> |
| 113 | + <echo message="The built dynamicjava.jar file has been copied to the lib directory. Please commit it to keep DrJava in sync with the koala code base." /> |
| 114 | + |
114 | 115 | <tempfile property="commit-comments-filename" |
115 | 116 | destdir="${java.io.tmpdir}" |
116 | 117 | prefix="commit-comments" /> |
|
126 | 127 | </cvs> |
127 | 128 | <delete file="${commit-comments-filename}"/> |
128 | 129 |
|
129 | | - <cvs command="tag -c ${version-tag}" quiet="true" compression="true" /> |
| 130 | + <cvs command="tag -c ${version-tag}" quiet="true" /> |
130 | 131 |
|
131 | 132 | <echo message="New version ${version-tag} committed to CVS." /> |
132 | 133 | <echo message="Note: This version has not yet been released. To release it, follow the process described at http://sourceforge.net/docman/display_doc.php?docid=9899&group_id=44253." /> |
|
196 | 197 | <!-- commit this version and then release it. --> |
197 | 198 | <target name="commit-and-release" depends="commit, release"> |
198 | 199 | </target> |
199 | | - |
| 200 | + |
200 | 201 | <!-- Compile. We have to start at srcroot and then selectively include |
201 | 202 | just this project in order for it to realize what files have already |
202 | 203 | been compiled (preventing needless recompilation). |
203 | 204 |
|
204 | | - This version works with JDK 1.5.0 |
205 | | ---> |
| 205 | + This version works with JDK 1.4.2 and JSR-14 v2.3+ as well as JDK 1.5.0. |
| 206 | + (Be sure to have the right version of tools.jar on your classpath.) |
| 207 | +--> |
206 | 208 | <target name="do-compile" depends="init"> |
207 | | - <mkdir dir="${compile-to}"/> |
208 | | - <javac sourcepath="" srcdir="${compile-from}" |
| 209 | + <mkdir dir="${built}"/> |
| 210 | + <javac srcdir="${srcroot}" |
209 | 211 | includes="${projpath}/**/*java" |
210 | | - destdir="${compile-to}" |
211 | | - classpath="${classpath_text}" |
| 212 | + destdir="${built}" |
| 213 | + bootclasspath="${jsr14_classpath}:${jsr14_collect_classpath}:${sun.boot.class.path}" |
| 214 | + classpath="${classpath_text}" |
212 | 215 | source="1.5" |
213 | | - target="jsr14" |
| 216 | + target="1.5" |
214 | 217 | debug="on" |
215 | 218 | fork="on" |
216 | 219 | optimize="off"> |
217 | 220 | <compilerarg value="-warnunchecked"/> |
| 221 | + <!--compilerarg value="-J-Xbootclasspath/p:${jsr14_classpath}"/--> |
218 | 222 | </javac> |
219 | 223 | </target> |
220 | 224 |
|
221 | | -<!-- Checked Compile. Identical to Compile with Generic Warning Checking |
222 | | - enabled. |
223 | | -
|
224 | | - This version works with JDK 1.5.0 |
| 225 | +<!-- Raw Compile. Identical to Compile with Generic Warning Checking |
| 226 | + disabled. |
225 | 227 | --> |
226 | 228 | <target name="checked-compile" depends="init"> |
227 | | - <mkdir dir="${compile-to}"/> |
228 | | - <javac sourcepath="" srcdir="${compile-from}" |
| 229 | + <mkdir dir="${built}"/> |
| 230 | + <javac srcdir="${srcroot}" |
229 | 231 | includes="${projpath}/**/*java" |
230 | | - destdir="${compile-to}" |
231 | | - classpath="${classpath_text}" |
| 232 | + destdir="${built}" |
| 233 | + bootclasspath="${jsr14_collect_classpath}:${sun.boot.class.path}" |
| 234 | + classpath="${classpath_text}" |
232 | 235 | source="1.5" |
| 236 | + target="jsr14" |
233 | 237 | debug="on" |
234 | 238 | fork="on" |
235 | 239 | optimize="off"> |
236 | | - <compilerarg value="-warnunchecked"/> |
| 240 | + <compilerarg value="-J-Xbootclasspath/p:${jsr14_classpath}"/> |
237 | 241 | </javac> |
238 | 242 | </target> |
239 | 243 |
|
|
257 | 261 | --> |
258 | 262 | <batchtest> |
259 | 263 | <!-- The root of the fileset must be where edu/ is. --> |
260 | | - <fileset dir="${srcroot}"> |
| 264 | + <fileset dir="${built}"> |
261 | 265 | <!-- Include only from projpath to only get classes in this project! |
262 | 266 | --> |
263 | | - <include name="${projpath}/**/*${test-spec}*Test.java" /> |
264 | | - <exclude name="**/AllTests.java" /> |
265 | | - <exclude name="**/Test.java" /> |
| 267 | + <include name="${projpath}/**/*${test-spec}*Test.class" /> |
| 268 | + <exclude name="**/AllTests.class" /> |
| 269 | + <exclude name="**/Test.class" /> |
266 | 270 | </fileset> |
267 | 271 | </batchtest> |
268 | 272 | </junit> |
|
274 | 278 |
|
275 | 279 | <!-- generate private javadoc for current uncommitted version --> |
276 | 280 | <target name="javadoc" depends="init, get-timestamp"> |
| 281 | + <tstamp_gmt /> |
277 | 282 | <antcall target="generate_javadoc"> |
278 | 283 | <param name="javadoc_dir" value="${private_javadoc_dir}" /> |
279 | 284 | <param name="javadoc_title" value="${user.name}-uncommitted-${ant.project.name}-${DSTAMP}-${TSTAMP}" /> |
|
284 | 289 | <!-- Generate javadoc, removing generics references first. |
285 | 290 | The property javadoc_dir must be set when calling this. |
286 | 291 | The property javadoc_title must be set when calling this. |
| 292 | + |
| 293 | + If using JSR14v2_4 and Ant 1.6, we can create javadoc containing |
| 294 | + the generics information. To do this, comment out the apply task |
| 295 | + that runs java since we don't want to strip out generics from the |
| 296 | + source, and then uncomment the lines in the blocks to copy the source |
| 297 | + code (since we usually do it in the call to java) and, finally |
| 298 | + uncomment the lines in the call to javadoc which set up the |
| 299 | + bootclasspath, source, and JVM args. You'll have to fudge |
| 300 | + around a little bit to get the ant syntax correct. |
287 | 301 | --> |
288 | 302 | <target name="generate_javadoc" if="javadoc_dir" depends="init"> |
289 | 303 | <delete dir="${javadoc_dir}" /> |
290 | 304 | <mkdir dir="${javadoc_dir}" /> |
291 | 305 |
|
292 | | - <javadoc sourcepath="${srcroot}" |
| 306 | + <mkdir dir="${javadoc_dir}/src" /> |
| 307 | + |
| 308 | + <!-- run jsr14 from jsr14.jar to make non-generic source. --> |
| 309 | + <!-- Comment this block out to produce javadocs with generics --> |
| 310 | + <apply executable="java" failonerror="yes" parallel="yes" type="file"> |
| 311 | + <arg value="-classpath" /> |
| 312 | + <arg value="${classpath_text}:${java.class.path}" /> |
| 313 | + <arg value="com.sun.tools.javac.Main" /> |
| 314 | + |
| 315 | + <arg value="-sourcepath" /> |
| 316 | + <arg value="${srcroot}" /> |
| 317 | + |
| 318 | + <arg value="-bootclasspath" /> |
| 319 | + <arg value="${jsr14_collect_classpath}:${sun.boot.class.path}" /> |
| 320 | + |
| 321 | + |
| 322 | + <!-- Generate Java source without generics --> |
| 323 | + <arg value="-s" /> |
| 324 | + |
| 325 | + <arg value="-d" /> |
| 326 | + <arg value="${javadoc_dir}/src" /> |
| 327 | + |
| 328 | + <fileset dir="${srcroot}"> |
| 329 | + <!-- get all projects within this sourceroot --> |
| 330 | + <exclude name="src-*/**/*.java" /> |
| 331 | + <include name="**/*.java" /> |
| 332 | + <!-- <include name="${projpath}/**/*.java" /> --> |
| 333 | + </fileset> |
| 334 | + </apply> |
| 335 | + |
| 336 | + <!-- Now we need to copy the package.htmls over to the |
| 337 | + directory with the non-generic sources. |
| 338 | + Also copy doc-files subdirectories. |
| 339 | + --> |
| 340 | + <copy todir="${javadoc_dir}/src"> |
| 341 | + <fileset dir="${srcroot}"> |
| 342 | + <!-- Uncomment the next two lines to produce javadocs with generics --> |
| 343 | + <!--exclude name="src-*/**/*.java" /--> |
| 344 | + <!--include name="**/*.java" /--> |
| 345 | + <include name="**/package.html" /> |
| 346 | + <include name="**/doc-files/**" /> |
| 347 | + </fileset> |
| 348 | + </copy> |
| 349 | + |
| 350 | + <javadoc sourcepath="${javadoc_dir}/src" |
293 | 351 | destdir="${javadoc_dir}" |
| 352 | + packagenames="edu.rice.cs.*" |
294 | 353 | Private="yes" |
295 | 354 | Use="yes" |
296 | 355 | Version="yes" |
297 | | - Windowtitle="${javadoc_title}" |
298 | | - linksource="yes" |
299 | | - packagenames="edu.rice.cs.*,koala,koala.*" |
300 | | - maxmemory="128m" |
301 | | - author="yes" |
302 | | - source="1.5"> |
| 356 | + Windowtitle="${javadoc_title}"> |
| 357 | +<!-- Bootclasspath ="${jsr14_classpath}:${jsr14_collect_classpath}:${sun.boot.class.path}" |
| 358 | + source="1.5"--> |
303 | 359 |
|
| 360 | + <!--arg value="-J-Xbootclasspath/p:${jsr14_classpath}"/--> |
304 | 361 | <classpath refid="classpath" /> |
305 | 362 |
|
306 | | - <arg value="-keywords" /> |
307 | | - |
308 | | - <header> |
309 | | - <![CDATA[<B>DrJava API Documentation</B>]]> |
310 | | - </header> |
311 | | - |
312 | | - <footer> |
313 | | - <![CDATA[<B>DrJava API Documentation</B>]]> |
314 | | - </footer> |
315 | | - |
316 | | - <group title="DrJava" packages="edu.rice.cs.drjava:edu.rice.cs.drjava.*"/> |
317 | | - <group title="Util" packages="edu.rice.cs.util:edu.rice.cs.util.*"/> |
318 | | - <group title="DynamicJava" packages="koala:koala.*"/> |
319 | | - |
320 | | - <link href="http://www.junit.org/junit/javadoc/3.8.1" /> |
321 | | - <link href="http://java.sun.com/j2se/1.5/docs/api" /> |
| 363 | + <link href="http://www.junit.org/junit/javadoc/3.7" /> |
| 364 | + <link href="http://java.sun.com/j2se/1.3/docs/api" /> |
| 365 | + <link href="http://koala.ilog.fr/djava/javadoc" /> |
322 | 366 | </javadoc> |
| 367 | + |
| 368 | + <!-- delete source we generated without generics --> |
| 369 | + <delete dir="${javadoc_dir}/src" /> |
323 | 370 | </target> |
324 | 371 |
|
325 | 372 | <!-- Delete all generated files (only for this project!) --> |
|
331 | 378 | <delete dir="${doc_dir}" /> |
332 | 379 | </target> |
333 | 380 |
|
334 | | -<!-- Clover targets --> |
335 | | -<taskdef resource="clovertasks"/> |
336 | | - |
337 | | -<target name="clover" |
338 | | - depends="clean-clover, with.clover, clean, test, clover-report" /> |
339 | | - |
340 | | -<target name="clean-clover"> |
341 | | - <delete dir="${clover_dir}/${ant.project.name}" /> |
342 | | - <delete dir="${clover_db_dir}" /> |
343 | | -</target> |
344 | | - |
345 | | -<target name="with.clover"> |
346 | | - <mkdir dir="${clover_db_dir}" /> |
347 | | - <clover-setup initString="${clover_db_dir}/test_coverage.db"> |
348 | | - <files> |
349 | | - <exclude name="**/*TestCase*.java" /> |
350 | | - <exclude name="**/*Test.java" /> |
351 | | - <exclude name="**/*TestCase.java" /> |
352 | | - <exclude name="**/*Test$*.java" /> |
353 | | - </files> |
354 | | - </clover-setup> |
355 | | -</target> |
356 | 381 |
|
357 | | -<target name="clover-report" depends="with.clover"> |
358 | | - <clover-report> |
359 | | - <current outfile="${clover_dir}/${ant.project.name}" |
360 | | - title="DrJava"> |
361 | | - <format type="html"/> |
362 | | - </current> |
363 | | - </clover-report> |
364 | | -</target> |
| 382 | + <!-- Target to fix JSR-14 v1.0's collect.jar to work in JDK 1.3. |
| 383 | + (We have to remove java.lang.String and java.util.Arrays, |
| 384 | + since they were somehow compiled against JDK 1.4.) --> |
| 385 | + <target name="fix-collect-v1_0"> |
| 386 | + <delete file="${jsr14_collect_classpath}.fixed" /> |
| 387 | + <zip destfile="${jsr14_collect_classpath}.fixed"> |
| 388 | + <zipfileset src="${jsr14_collect_classpath}" |
| 389 | + excludes="java/lang/String.class,java/util/Arrays.class" /> |
| 390 | + </zip> |
| 391 | + <move file="${jsr14_collect_classpath}.fixed" |
| 392 | + toFile="${jsr14_collect_classpath}" |
| 393 | + overwrite="true" /> |
| 394 | + </target> |
| 395 | + |
| 396 | + <!-- Clover targets --> |
| 397 | + <taskdef resource="clovertasks"/> |
| 398 | + |
| 399 | + <target name="clover" |
| 400 | + depends="clean-clover, with.clover, clean, test, clover-report" /> |
| 401 | + |
| 402 | + <target name="clean-clover"> |
| 403 | + <delete dir="${clover_dir}/${ant.project.name}" /> |
| 404 | + <delete dir="${clover_db_dir}" /> |
| 405 | + </target> |
| 406 | + |
| 407 | + <target name="with.clover"> |
| 408 | + <mkdir dir="${clover_db_dir}" /> |
| 409 | + <clover-setup initString="${clover_db_dir}/test_coverage.db"> |
| 410 | + <files> |
| 411 | + <exclude name="**/*Test.java" /> |
| 412 | + <exclude name="**/*TestCase.java" /> |
| 413 | + <exclude name="**/*Test$*.java" /> |
| 414 | + </files> |
| 415 | + </clover-setup> |
| 416 | + </target> |
| 417 | + |
| 418 | + <target name="clover-report" depends="with.clover"> |
| 419 | + <clover-report> |
| 420 | + <current outfile="${clover_dir}/${ant.project.name}" |
| 421 | + title="DrJava"> |
| 422 | + <format type="html"/> |
| 423 | + </current> |
| 424 | + </clover-report> |
| 425 | + </target> |
0 commit comments