Skip to content

Commit 13106d8

Browse files
author
dlsmith
committed
Rolled back build-common.*. It turns out these are NOT identical to
edu/rice/cs/drjava/build-common.*. This should be fixed in the future. git-svn-id: file:///tmp/test-svn/trunk@3242 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent d6b5d9d commit 13106d8

3 files changed

Lines changed: 371 additions & 346 deletions

File tree

dynamicjava/src/koala/build-common.xml

Lines changed: 157 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,22 @@
88
srcroot
99
projpath
1010
public_javadoc_dir
11-
12-
These are optional:
13-
compile-from
14-
compile-to
1511
1612
Assumes these targets exist:
1713
stable
1814
development
15+
jar
1916
2017
-->
2118
<!-- <taskdef name="javamake" classname="com.sun.tools.javamake.ant.JavaMake"/> -->
2219

23-
<property name="compile-from" value="${srcroot}" />
24-
<property name="compile-to" value="${built}" />
25-
2620
<property name="build.sysclasspath" value="last" />
2721

2822
<property name="lib_dir" value="${srcroot}/edu/rice/cs/lib" />
2923

24+
<property name="jsr14_classpath" value="${lib_dir}/jsr14.jar" />
25+
<property name="jsr14_collect_classpath" value="${lib_dir}/collect.jar" />
26+
3027
<property name="jars_dir" value="/home/javaplt/public_html/drjava/builds" />
3128

3229
<!-- put javadoc in this directory if generating private javadoc -->
@@ -44,20 +41,18 @@
4441

4542
<!-- classpath to use everywhere. -->
4643
<path id="classpath">
47-
44+
<pathelement location="${jsr14_classpath}" />
4845
<!-- <pathelement path="${java.class.path}" /> -->
4946
<fileset dir="${lib_dir}">
5047
<include name="*.jar" />
51-
<exclude name="jsr14.jar" />
52-
<exclude name="collect.jar" />
5348
</fileset>
5449
<pathelement path="${built}" />
5550
</path>
5651

5752
<!-- Init target. All others depend on it. Initialize the directory. -->
5853
<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" /> -->
6156
<mkdir dir="${built}" /> <!-- Make the built directory -->
6257

6358
<pathconvert refid="classpath"
@@ -66,24 +61,27 @@
6661

6762
</target>
6863

69-
7064
<!-- Get a timestamp based on GMT, rather than local time -->
7165
<target name="get-timestamp">
7266
<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" />
7670
</tstamp>
7771
</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>
8076

8177
<!-- Reconcile source with CVS archive -->
8278
<target name="update" depends="init">
83-
<cvs command="update -d -P" compression="true" />
79+
<cvs command="update -d -P" />
8480
</target>
8581

8682
<target name="make-version-stamp" depends="get-timestamp">
83+
<tstamp_gmt /> <!-- get new time stamp to use for CVS tag -->
84+
8785
<!-- Create new Version.java, filling in date and time. -->
8886
<filter token="DATE" value="${DSTAMP}" />
8987
<filter token="TIME" value="${TSTAMP}" />
@@ -98,19 +96,22 @@
9896
<!-- Commit source to CVS archive
9997
Before doing do, we update our copy with the CVS copy. This ensures that
10098
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.
102100
103101
After committing, we tag the build we just made with the tag
104102
projectname-date-time.
105103
-->
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">
107105
<property name="version-tag"
108106
value="${ant.project.name}-${DSTAMP}-${TSTAMP}" />
109107

110108
<!-- recompile to make new version number get into code. -->
111109
<echo message="All tests passed. Rebuilding to put version tag (${version-tag}) into the code." />
112110
<antcall target="compile" />
113111

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+
114115
<tempfile property="commit-comments-filename"
115116
destdir="${java.io.tmpdir}"
116117
prefix="commit-comments" />
@@ -126,7 +127,7 @@
126127
</cvs>
127128
<delete file="${commit-comments-filename}"/>
128129

129-
<cvs command="tag -c ${version-tag}" quiet="true" compression="true" />
130+
<cvs command="tag -c ${version-tag}" quiet="true" />
130131

131132
<echo message="New version ${version-tag} committed to CVS." />
132133
<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&amp;group_id=44253." />
@@ -196,44 +197,47 @@
196197
<!-- commit this version and then release it. -->
197198
<target name="commit-and-release" depends="commit, release">
198199
</target>
199-
200+
200201
<!-- Compile. We have to start at srcroot and then selectively include
201202
just this project in order for it to realize what files have already
202203
been compiled (preventing needless recompilation).
203204
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+
-->
206208
<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}"
209211
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}"
212215
source="1.5"
213-
target="jsr14"
216+
target="1.5"
214217
debug="on"
215218
fork="on"
216219
optimize="off">
217220
<compilerarg value="-warnunchecked"/>
221+
<!--compilerarg value="-J-Xbootclasspath/p:${jsr14_classpath}"/-->
218222
</javac>
219223
</target>
220224

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.
225227
-->
226228
<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}"
229231
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}"
232235
source="1.5"
236+
target="jsr14"
233237
debug="on"
234238
fork="on"
235239
optimize="off">
236-
<compilerarg value="-warnunchecked"/>
240+
<compilerarg value="-J-Xbootclasspath/p:${jsr14_classpath}"/>
237241
</javac>
238242
</target>
239243

@@ -257,12 +261,12 @@
257261
-->
258262
<batchtest>
259263
<!-- The root of the fileset must be where edu/ is. -->
260-
<fileset dir="${srcroot}">
264+
<fileset dir="${built}">
261265
<!-- Include only from projpath to only get classes in this project!
262266
-->
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" />
266270
</fileset>
267271
</batchtest>
268272
</junit>
@@ -274,6 +278,7 @@
274278

275279
<!-- generate private javadoc for current uncommitted version -->
276280
<target name="javadoc" depends="init, get-timestamp">
281+
<tstamp_gmt />
277282
<antcall target="generate_javadoc">
278283
<param name="javadoc_dir" value="${private_javadoc_dir}" />
279284
<param name="javadoc_title" value="${user.name}-uncommitted-${ant.project.name}-${DSTAMP}-${TSTAMP}" />
@@ -284,42 +289,84 @@
284289
<!-- Generate javadoc, removing generics references first.
285290
The property javadoc_dir must be set when calling this.
286291
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.
287301
-->
288302
<target name="generate_javadoc" if="javadoc_dir" depends="init">
289303
<delete dir="${javadoc_dir}" />
290304
<mkdir dir="${javadoc_dir}" />
291305

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"
293351
destdir="${javadoc_dir}"
352+
packagenames="edu.rice.cs.*"
294353
Private="yes"
295354
Use="yes"
296355
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"-->
303359

360+
<!--arg value="-J-Xbootclasspath/p:${jsr14_classpath}"/-->
304361
<classpath refid="classpath" />
305362

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" />
322366
</javadoc>
367+
368+
<!-- delete source we generated without generics -->
369+
<delete dir="${javadoc_dir}/src" />
323370
</target>
324371

325372
<!-- Delete all generated files (only for this project!) -->
@@ -331,34 +378,48 @@
331378
<delete dir="${doc_dir}" />
332379
</target>
333380

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>
356381

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

Comments
 (0)