From 71e9ab7f98f653e5a1099aecba766bd4260bff90 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 31 May 2025 01:44:36 -0700 Subject: [PATCH] Add collect files recursively configuration option --- .../java/rife/bld/extension/PmdOperation.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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_);