You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by jg...@apache.org on 2004/12/11 00:16:09 UTC
cvs commit: ant/docs/manual/CoreTasks javac.html
jglick 2004/12/10 15:16:09
Modified: docs/manual/CoreTasks javac.html
Log:
The manual strongly encourages you to specify source/target levels, yet it gave no examples that did so! Putting
in some usages to plant the bug in people's minds. (Especially important for people just starting to use JDK
1.5, which changed the default source level.)
Revision Changes Path
1.49 +14 -4 ant/docs/manual/CoreTasks/javac.html
Index: javac.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/javac.html,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- javac.html 19 Nov 2004 09:07:09 -0000 1.48
+++ javac.html 10 Dec 2004 23:16:08 -0000 1.49
@@ -416,31 +416,39 @@
destdir="${build}"
classpath="xyz.jar"
debug="on"
+ source="1.4"
/></pre>
<p>compiles all <code>.java</code> files under the <code>${src}</code>
directory, and stores
the <code>.class</code> files in the <code>${build}</code> directory.
The classpath used includes <code>xyz.jar</code>, and compiling with
-debug information is on.</p>
+debug information is on. The source level is 1.4,
+so you can use <code>assert</code> statements.</p>
<pre> <javac srcdir="${src}"
destdir="${build}"
fork="true"
+ source="1.2"
+ target="1.2"
/></pre>
<p>compiles all <code>.java</code> files under the <code>${src}</code>
directory, and stores the <code>.class</code> files in the
<code>${build}</code> directory. This will fork off the javac
-compiler using the default <code>javac</code> executable.</p>
+compiler using the default <code>javac</code> executable.
+The source level is 1.2 (similar to 1.1 or 1.3) and
+the class files should be runnable under JDK 1.2+ as well.</p>
<pre> <javac srcdir="${src}"
destdir="${build}"
fork="java$$javac.exe"
+ source="1.5"
/></pre>
<p>compiles all <code>.java</code> files under the <code>${src}</code>
directory, and stores the <code>.class</code> files in the
<code>${build}</code> directory. This will fork off the javac
compiler, using the executable named <code>java$javac.exe</code>. Note
-that the <code>$</code> sign needs to be escaped by a second one.</p>
+that the <code>$</code> sign needs to be escaped by a second one.
+The source level is 1.5, so you can use generics.</p>
<pre> <javac srcdir="${src}"
destdir="${build}"
@@ -455,7 +463,9 @@
The classpath used includes <code>xyz.jar</code>, and debug information is on.
Only files under <code>mypackage/p1</code> and <code>mypackage/p2</code> are
used. All files in and below the <code>mypackage/p1/testpackage</code>
-directory are excluded from compilation.</p>
+directory are excluded from compilation.
+You didn't specify a source or target level,
+so the actual values used will depend on which JDK you ran Ant with.</p>
<pre> <javac srcdir="${src}:${src2}"
destdir="${build}"
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org