Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hides the warning if the classes directory/fileset is missing #163

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/main/java/de/thetaphi/forbiddenapis/ant/AntTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void error(String msg) {
@Override
public void warn(String msg) {
// ANT has no real log levels printed, so prefix with "WARNING":
log("WARNING: " + msg, Project.MSG_WARN);
log("WARNING: ".concat(msg), Project.MSG_WARN);
}

@Override
Expand Down Expand Up @@ -188,8 +188,7 @@ public void info(String msg) {
}
if (!foundClass) {
if (ignoreEmptyFileset) {
log.warn("There is no <fileset/> or other resource collection given, or the collection does not contain any class files to check.");
log.info("Scanned 0 class files.");
log.info("Resource collection of class files is empty. Scanned 0 class files.");
return;
} else {
throw new BuildException("There is no <fileset/> or other resource collection given, or the collection does not contain any class files to check.");
Expand Down Expand Up @@ -341,7 +340,7 @@ public void setRestrictClassFilename(boolean restrictClassFilename) {
this.restrictClassFilename = restrictClassFilename;
}

/** Ignore empty fileset/resource collection and print a warning instead.
/** Ignore empty fileset/resource collection.
* Defaults to {@code false}.
*/
public void setIgnoreEmptyFileSet(boolean ignoreEmptyFileset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public void info(String msg) {
log.info("Scanning for classes to check...");
final File classesDirectory = getClassesDirectory();
if (!classesDirectory.exists()) {
log.warn("Classes directory does not exist, forbiddenapis check skipped: " + classesDirectory);
log.info("Classes directory does not exist, forbiddenapis check skipped: " + classesDirectory);
return;
}
final DirectoryScanner ds = new DirectoryScanner();
Expand All @@ -348,7 +348,7 @@ public void info(String msg) {
ds.scan();
final String[] files = ds.getIncludedFiles();
if (files.length == 0) {
log.warn(String.format(Locale.ENGLISH,
log.info(String.format(Locale.ENGLISH,
"No classes found in '%s' (includes=%s, excludes=%s), forbiddenapis check skipped.",
classesDirectory.toString(), Arrays.toString(includes), Arrays.toString(excludes)));
return;
Expand Down