umagesh 01/11/20 14:24:14
Modified: . WHATSNEW
docs/manual/CoreTasks javac.html
src/main/org/apache/tools/ant/taskdefs Javac.java
src/main/org/apache/tools/ant/taskdefs/compilers
DefaultCompilerAdapter.java
Log:
New debuglevel attribute for Javac - will be used only when the modern
complier is used.
PR: 4127
Revision Changes Path
1.174 +4 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -r1.173 -r1.174
--- WHATSNEW 2001/11/20 02:34:32 1.173
+++ WHATSNEW 2001/11/20 22:24:14 1.174
@@ -41,6 +41,10 @@
Other changes:
--------------
+* Javac task allows debug levels to be spcified. Debug levels
+ will have an effect only when the modern compiler is used.
+
+* Mail task allows specification of port number.
* Added support for specifying CVS_RSH in the <cvs/> task
1.17 +32 -21 jakarta-ant/docs/manual/CoreTasks/javac.html
Index: javac.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/javac.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- javac.html 2001/11/05 15:19:20 1.16
+++ javac.html 2001/11/20 22:24:14 1.17
@@ -178,40 +178,40 @@
<td align="center" valign="top">No</td>
</tr>
<tr>
- <td valign="top">includeAntRuntime</td>
+ <td valign="top">includeAntRuntime</td>
<td valign="top">whether to include the Ant run-time libraries;
defaults to <code>yes</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
- <td valign="top">includeJavaRuntime</td>
+ <td valign="top">includeJavaRuntime</td>
<td valign="top">whether to include the default run-time
libraries from the executing VM; defaults to <code>no</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
- <td valign="top">fork</td>
+ <td valign="top">fork</td>
<td valign="top">whether to execute Javac using the JDK compiler
externally; defaults to <code>no</code>. You can also give a
complete path to the javac executable to use instead of
<code>yes</code>, which would run the compiler of the Java
vesrion that is currently running Ant.</td>
<td align="center" valign="top">No</td>
- </tr>
+ </tr>
<tr>
- <td valign="top">memoryInitialSize</td>
+ <td valign="top">memoryInitialSize</td>
<td valign="top">the initial size of the memory for the underlying VM,
if javac is run
externally, ignored otherwise; defaults to the standard VM memory
setting.
(examples: <code>83886080</code>, <code>81920k</code>, or
<code>80m</code>)</td>
<td align="center" valign="top">No</td>
- </tr>
+ </tr>
<tr>
- <td valign="top">memoryMaximumSize</td>
+ <td valign="top">memoryMaximumSize</td>
<td valign="top">the maximum size of the memory for the underlying VM,
if javac is run
externally, ignored otherwise; defaults to the standard VM memory
setting.
(examples: <code>83886080</code>, <code>81920k</code>, or
<code>80m</code>)</td>
<td align="center" valign="top">No</td>
- </tr>
+ </tr>
<tr>
<td valign="top">failonerror</td> <td valign="top">
indicates whether the build will continue even if there are
compilation errors; defaults to <code>true</code>.
@@ -219,14 +219,25 @@
<td align="center" valign="top">No</td>
</tr>
<tr>
- <td valign="top">source</td>
+ <td valign="top">source</td>
<td valign="top">Value of the <code>-source</code> command line
switch, will be ignored by all implementations except
<code>modern</code>, legal values are "1.3" and
"1.4" - by default, no <code>-source</code> argument
will be used at all.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">debuglevel</td>
+ <td valign="top">Keyword list to be appended to the <code>-g</code>
command line
+ switch. This will be ignored by all implementations except
+ <code>modern</code>, legal values are "none" or a comma
separated list of
+ the following keywords. Valid keywords are "lines",
"vars" and
+ "source" - if debuglevel is not specified, by default, nothing
will be
+ appended to <code>-g</code>
+ </td>
<td align="center" valign="top">No</td>
- </tr>
+ </tr>
</table>
<h3>Parameters specified as nested elements</h3>
@@ -259,21 +270,21 @@
<td width="10%" valign="top"><b>Required</b></td>
</tr>
<tr>
- <td valign="top">value</td>
+ <td valign="top">value</td>
<td align="center" rowspan="4">See <a
href="../using.html#arg">here</a></td>
<td align="center" rowspan="4">Exactly one of these.</td>
</tr>
<tr>
- <td valign="top">line</td>
+ <td valign="top">line</td>
</tr>
<tr>
- <td valign="top">file</td>
+ <td valign="top">file</td>
</tr>
<tr>
- <td valign="top">path</td>
+ <td valign="top">path</td>
</tr>
<tr>
- <td valign="top">implementation</td>
+ <td valign="top">implementation</td>
<td align="center">Only use this argument if the chosen
implementation matches this attribute. Possible choices are the
same as those of the build.compiler property.</td>
@@ -355,7 +366,7 @@
<p><b>Note:</b> If you wish to compile only source-files located in some
packages below a
common root you should not include these packages in the srcdir-attribute.
Use include/exclude-attributes
-or elements to filter for these packages. If you include part of your
package-structure inside the srcdir-attribute
+or elements to filter for these packages. If you include part of your
package-structure inside the srcdir-attribute
(or nested src-elements) Ant will start to recompile your sources every time
you call it.</p>
<h3>Jikes Notes</h3>
@@ -371,7 +382,7 @@
<tr>
<td valign="top">
build.compiler.emacs
- </td>
+ </td>
<td valign="top">
Enable emacs compatible error messages
</td>
@@ -381,7 +392,7 @@
build.compiler.warnings<br>
<b>This property has been deprecated, use the nowarn attribute
instead</b>
- </td>
+ </td>
<td valign="top">
don't disable warning messages
</td>
@@ -389,7 +400,7 @@
<tr>
<td valign="top">
build.compiler.pedantic
- </td>
+ </td>
<td valign="top">
enable pedantic warnings
</td>
@@ -397,9 +408,9 @@
<tr>
<td valign="top">
build.compiler.fulldepend
- </td>
+ </td>
<td valign="top">
- enable full dependency checking,<br>
+ enable full dependency checking,<br>
"+F" in the jikes manual.
</td>
</tr>
1.75 +17 -0
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- Javac.java 2001/11/06 13:07:02 1.74
+++ Javac.java 2001/11/20 22:24:14 1.75
@@ -133,7 +133,24 @@
protected File[] compileList = new File[0];
private String source;
+ private String debugLevel;
+ /**
+ * Get the value of debugLevel.
+ * @return value of debugLevel.
+ */
+ public String getDebugLevel() {
+ return debugLevel;
+ }
+
+ /**
+ * Set the value of debugLevel.
+ * @param v Value to assign to debugLevel.
+ */
+ public void setDebugLevel(String v) {
+ this.debugLevel = v;
+ }
+
/**
* Get the value of source.
* @return value of source.
1.17 +17 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Index: DefaultCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- DefaultCompilerAdapter.java 2001/11/06 10:47:33 1.16
+++ DefaultCompilerAdapter.java 2001/11/20 22:24:14 1.17
@@ -173,11 +173,16 @@
return classpath;
}
+ protected Commandline setupJavacCommandlineSwitches(Commandline cmd) {
+ return setupJavacCommandlineSwitches(cmd, false);
+ }
+
/**
* Does the command line argument processing common to classic and
* modern. Doesn't add the files to compile.
*/
- protected Commandline setupJavacCommandlineSwitches(Commandline cmd) {
+ protected Commandline setupJavacCommandlineSwitches(Commandline cmd,
+ boolean
useDebugLevel) {
Path classpath = getCompileClasspath();
// we cannot be using Java 1.0 when forking, so we only have to
@@ -257,7 +262,16 @@
cmd.createArgument().setValue(encoding);
}
if (debug) {
- cmd.createArgument().setValue("-g");
+ if (useDebugLevel) {
+ String debugLevel = attributes.getDebugLevel();
+ if (debugLevel != null) {
+ cmd.createArgument().setValue("-g:" + debugLevel);
+ } else {
+ cmd.createArgument().setValue("-g");
+ }
+ } else {
+ cmd.createArgument().setValue("-g");
+ }
} else if (Project.getJavaVersion() != Project.JAVA_1_0 &&
Project.getJavaVersion() != Project.JAVA_1_1) {
cmd.createArgument().setValue("-g:none");
@@ -291,7 +305,7 @@
* add the files to compile.
*/
protected Commandline setupModernJavacCommandlineSwitches(Commandline
cmd) {
- setupJavacCommandlineSwitches(cmd);
+ setupJavacCommandlineSwitches(cmd, true);
if (attributes.getSource() != null) {
cmd.createArgument().setValue("-source");
cmd.createArgument().setValue(attributes.getSource());
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>