|
|
@@ -434,6 +434,11 @@ public class Javadoc extends Task { |
|
|
|
* Javadoc error. |
|
|
|
*/ |
|
|
|
private boolean failOnError = false; |
|
|
|
/** |
|
|
|
* Flag which indicates if the task should fail if there is a |
|
|
|
* Javadoc warning. |
|
|
|
*/ |
|
|
|
private boolean failOnWarning = false; |
|
|
|
private Path sourcePath = null; |
|
|
|
private File destDir = null; |
|
|
|
private Vector<SourceFile> sourceFiles = new Vector<SourceFile>(); |
|
|
@@ -1553,6 +1558,18 @@ public class Javadoc extends Task { |
|
|
|
failOnError = b; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Should the build process fail if Javadoc warns (as indicated by |
|
|
|
* the word "warning" on stdout)? |
|
|
|
* |
|
|
|
* <p>Default is false.</p> |
|
|
|
* @param b a <code>boolean</code> value |
|
|
|
* @since Ant 1.9.4 |
|
|
|
*/ |
|
|
|
public void setFailonwarning(boolean b) { |
|
|
|
failOnWarning = b; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Enables the -source switch, will be ignored if Javadoc is not |
|
|
|
* the 1.4 version. |
|
|
@@ -1787,6 +1804,10 @@ public class Javadoc extends Task { |
|
|
|
throw new BuildException("Javadoc returned " + ret, |
|
|
|
getLocation()); |
|
|
|
} |
|
|
|
if (out.sawWarnings() && failOnWarning) { |
|
|
|
throw new BuildException("Javadoc issued warnings.", |
|
|
|
getLocation()); |
|
|
|
} |
|
|
|
postProcessGeneratedJavadocs(); |
|
|
|
} catch (IOException e) { |
|
|
|
throw new BuildException("Javadoc failed: " + e, e, getLocation()); |
|
|
@@ -2548,7 +2569,11 @@ public class Javadoc extends Task { |
|
|
|
// unless they appear after what could be an informational message. |
|
|
|
// |
|
|
|
private String queuedLine = null; |
|
|
|
private boolean sawWarnings = false; |
|
|
|
protected void processLine(String line, int messageLevel) { |
|
|
|
if (line.contains("warning")) { |
|
|
|
sawWarnings = true; |
|
|
|
} |
|
|
|
if (messageLevel == Project.MSG_INFO |
|
|
|
&& line.startsWith("Generating ")) { |
|
|
|
if (queuedLine != null) { |
|
|
@@ -2575,6 +2600,10 @@ public class Javadoc extends Task { |
|
|
|
queuedLine = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public boolean sawWarnings() { |
|
|
|
return sawWarnings; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|