umagesh 01/11/21 15:09:39
Modified: . WHATSNEW
docs/manual/CoreTasks javac.html
src/main/org/apache/tools/ant/taskdefs/compilers
DefaultCompilerAdapter.java Javac12.java
Log:
Classic compiler, so long as it is not Version 1.0 or 1.1.x, also recognizes
debuglevel.
Revision Changes Path
1.178 +4 -2 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -r1.177 -r1.178
--- WHATSNEW 2001/11/21 22:36:12 1.177
+++ WHATSNEW 2001/11/21 23:09:39 1.178
@@ -49,8 +49,10 @@
select files from an archive for extraction. Filesets may be
used to select archived files for unarchival.
-* Javac task allows debug levels to be spcified. Debug levels
- will have an effect only when the modern compiler is used.
+* Javac task allows debug levels to be specified. Debug levels
+ will have an effect only when the modern compiler or the
+ classic compiler (version 1.2 and higher) is used and debugging
+ is enabled.
* Mail task allows specification of port number.
1.18 +6 -4 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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- javac.html 2001/11/20 22:24:14 1.17
+++ javac.html 2001/11/21 23:09:39 1.18
@@ -231,10 +231,12 @@
<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>
+ <code>modern</code> and <code>classic(ver >= 1.2)</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>. If debug is not turned on, this attribute
will be
+ ignored.
</td>
<td align="center" valign="top">No</td>
</tr>
1.18 +10 -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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DefaultCompilerAdapter.java 2001/11/20 22:24:14 1.17
+++ DefaultCompilerAdapter.java 2001/11/21 23:09:39 1.18
@@ -262,7 +262,10 @@
cmd.createArgument().setValue(encoding);
}
if (debug) {
- if (useDebugLevel) {
+ if (useDebugLevel
+ && Project.getJavaVersion() != Project.JAVA_1_0
+ && Project.getJavaVersion() != Project.JAVA_1_1) {
+
String debugLevel = attributes.getDebugLevel();
if (debugLevel != null) {
cmd.createArgument().setValue("-g:" + debugLevel);
@@ -325,13 +328,17 @@
return cmd;
}
+ protected Commandline setupJavacCommand() {
+ return setupJavacCommand(false);
+ }
+
/**
* Does the command line argument processing for classic and adds
* the files to compile as well.
*/
- protected Commandline setupJavacCommand() {
+ protected Commandline setupJavacCommand(boolean debugLevelCheck) {
Commandline cmd = new Commandline();
- setupJavacCommandlineSwitches(cmd);
+ setupJavacCommandlineSwitches(cmd, debugLevelCheck);
logAndAddFilesToCompile(cmd);
return cmd;
}
1.4 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
Index: Javac12.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Javac12.java 2001/10/28 21:27:51 1.3
+++ Javac12.java 2001/11/21 23:09:39 1.4
@@ -71,14 +71,14 @@
*
* @author James Davidson <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
* @author Robin Green <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
* @author <a href="mailto:[EMAIL PROTECTED]">J D Glanville</a>
*/
public class Javac12 extends DefaultCompilerAdapter {
public boolean execute() throws BuildException {
attributes.log("Using classic compiler", Project.MSG_VERBOSE);
- Commandline cmd = setupJavacCommand();
+ Commandline cmd = setupJavacCommand(true);
OutputStream logstr = new LogOutputStream(attributes,
Project.MSG_WARN);
try {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>