diff --git a/src/main/java/rife/bld/extension/PmdOperation.java b/src/main/java/rife/bld/extension/PmdOperation.java index 25b25c6..577d5e0 100644 --- a/src/main/java/rife/bld/extension/PmdOperation.java +++ b/src/main/java/rife/bld/extension/PmdOperation.java @@ -353,6 +353,19 @@ public class PmdOperation extends AbstractOperation { return cache(Path.of(cache)); } + /** + * When specified, any directory mentioned with {@link #inputPaths()} will only be searched for files that are + * direct children. By default, subdirectories are recursively included. + * + * @param collectFilesRecursively whether to collect files recursively or not + * @return this operation + * @since 1.2.4 + */ + public PmdOperation collectFilesRecursively(boolean collectFilesRecursively) { + this.collectFilesRecursively_ = collectFilesRecursively; + return this; + } + /** * Sets the default language version to be used for all input files. * @@ -625,6 +638,11 @@ public class PmdOperation extends AbstractOperation { // addRelativizeRoots config.addRelativizeRoots(relativizeRoots_.stream().toList()); + // collectFilesRecursively + if (!collectFilesRecursively_) { + config.collectFilesRecursively(false); + } + // prependAuxClasspath if (prependClasspath_ != null) { config.prependAuxClasspath(prependClasspath_);