bodewig 01/08/12 23:32:02
Modified: . Tag: ANT_14_BRANCH WHATSNEW
docs Tag: ANT_14_BRANCH faq.html
docs/manual/CoreTasks Tag: ANT_14_BRANCH javac.html
src/main/org/apache/tools/ant/taskdefs Tag: ANT_14_BRANCH
Javac.java
src/main/org/apache/tools/ant/taskdefs/compilers Tag:
ANT_14_BRANCH DefaultCompilerAdapter.java
Jikes.java
xdocs Tag: ANT_14_BRANCH faq.xml
Log:
Added nowarn attribute to <javac> as it applies to "normal" javac as
well as to jikes.
Revision Changes Path
No revision
No revision
1.144.2.4 +3 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.144.2.3
retrieving revision 1.144.2.4
diff -u -r1.144.2.3 -r1.144.2.4
--- WHATSNEW 2001/08/12 08:37:48 1.144.2.3
+++ WHATSNEW 2001/08/13 06:32:01 1.144.2.4
@@ -223,6 +223,9 @@
* Introduced the concept of <filtersets> to allow for more control in which
filters get applied in a <copy> or <move> operation.
+* Added nowarn attribute to javac and deprecated the Jikes-magic property
+ build.compiler.warnings.
+
Fixed bugs:
-----------
No revision
No revision
1.2.2.1 +9 -8 jakarta-ant/docs/faq.html
Index: faq.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/faq.html,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- faq.html 2001/08/07 14:51:49 1.2
+++ faq.html 2001/08/13 06:32:01 1.2.2.1
@@ -512,19 +512,19 @@
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- -nowarn
+ +P
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- build.compiler.warnings
+ build.compiler.pedantic
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- true == not set
+ false == not set
</font>
</td>
</tr>
@@ -532,13 +532,13 @@
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- +P
+ +F
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- build.compiler.pedantic
+ build.compiler.fulldepend
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
@@ -552,19 +552,20 @@
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- +F
+ <strong>only for Ant < 1.4, replaced by the nowarn
+ attribute of javac after that</strong> -nowarn
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- build.compiler.fulldepend
+ build.compiler.warnings
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
- false == not set
+ true == not set
</font>
</td>
</tr>
No revision
No revision
1.10.2.1 +6 -0 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.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- javac.html 2001/08/07 11:53:42 1.10
+++ javac.html 2001/08/13 06:32:02 1.10.2.1
@@ -138,6 +138,12 @@
<td align="center" valign="top">No</td>
</tr>
<tr>
+ <td valign="top">nowarn</td>
+ <td valign="top">indicates whether -nowarn switch should be passed
+ to the compiler; defaults to <code>off</code>.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
<td valign="top">debug</td>
<td valign="top">indicates whether source should be compiled with debug
information; defaults to <code>off</code>.</td>
No revision
No revision
1.67.2.1 +15 -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.67
retrieving revision 1.67.2.1
diff -u -r1.67 -r1.67.2.1
--- Javac.java 2001/08/07 11:53:43 1.67
+++ Javac.java 2001/08/13 06:32:02 1.67.2.1
@@ -115,6 +115,7 @@
private boolean includeAntRuntime = true;
private boolean includeJavaRuntime = false;
private boolean fork = false;
+ private boolean nowarn = false;
protected boolean failOnError = true;
protected File[] compileList = new File[0];
@@ -409,6 +410,20 @@
this.fork = fork;
}
+
+ /**
+ * Sets whether the -nowarn option should be used.
+ */
+ public void setNowarn(boolean flag) {
+ this.nowarn = flag;
+ }
+
+ /**
+ * Should the -nowarn option be used.
+ */
+ public boolean getNowarn() {
+ return nowarn;
+ }
/**
* Executes the task.
No revision
No revision
1.6.2.1 +4 -0
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.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- DefaultCompilerAdapter.java 2001/08/03 14:36:48 1.6
+++ DefaultCompilerAdapter.java 2001/08/13 06:32:02 1.6.2.1
@@ -206,6 +206,10 @@
protected Commandline setupJavacCommandlineSwitches(Commandline cmd) {
Path classpath = getCompileClasspath();
+ if (attributes.getNowarn()) {
+ cmd.createArgument().setValue("-nowarn");
+ }
+
if (deprecation == true) {
cmd.createArgument().setValue("-deprecation");
}
1.1.4.1 +15 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java
Index: Jikes.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -r1.1 -r1.1.4.1
--- Jikes.java 2001/01/12 14:08:51 1.1
+++ Jikes.java 2001/08/13 06:32:02 1.1.4.1
@@ -173,7 +173,21 @@
* warning can be pretty annoying.
*/
String warningsProperty =
project.getProperty("build.compiler.warnings");
- if (warningsProperty != null &&
!Project.toBoolean(warningsProperty)) {
+ if (warningsProperty != null) {
+ attributes.log("!! the build.compiler.warnings property is
deprecated. !!",
+ Project.MSG_WARN);
+ attributes.log("!! Use the nowarn attribute instead. !!",
+ Project.MSG_WARN);
+ if (!Project.toBoolean(warningsProperty)) {
+ cmd.createArgument().setValue("-nowarn");
+ }
+ } if (attributes.getNowarn()) {
+ /*
+ * FIXME later
+ *
+ * let the magic property win over the attribute for backwards
+ * compatibility
+ */
cmd.createArgument().setValue("-nowarn");
}
No revision
No revision
1.1.2.1 +8 -6 jakarta-ant/xdocs/faq.xml
Index: faq.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/xdocs/faq.xml,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- faq.xml 2001/08/07 13:49:48 1.1
+++ faq.xml 2001/08/13 06:32:02 1.1.2.1
@@ -176,12 +176,6 @@
</tr>
<tr>
- <td>-nowarn</td>
- <td>build.compiler.warnings</td>
- <td>true == not set</td>
- </tr>
-
- <tr>
<td>+P</td>
<td>build.compiler.pedantic</td>
<td>false == not set</td>
@@ -192,6 +186,14 @@
<td>build.compiler.fulldepend</td>
<td>false == not set</td>
</tr>
+
+ <tr>
+ <td><strong>only for Ant < 1.4, replaced by the nowarn
+ attribute of javac after that</strong> -nowarn</td>
+ <td>build.compiler.warnings</td>
+ <td>true == not set</td>
+ </tr>
+
</table>
</answer>