desruisseaux commented on code in PR #2236:
URL: https://github.com/apache/maven/pull/2236#discussion_r2029895425


##########
api/maven-api-core/src/main/java/org/apache/maven/api/SourceRoot.java:
##########
@@ -46,23 +46,39 @@ default Path directory() {
     }
 
     /**
-     * {@return the list of pattern matchers for the files to include}.
+     * {@return the list of patterns for the files to include}.
+     * The path separator is {@code /} on all platforms, including Windows.
+     * The prefix before the {@code :} character, if present and longer than 1 
character, is the syntax.
+     * If no syntax is specified, or if its length is 1 character (interpreted 
as a Windows drive),
+     * the default is a Maven-specific variation of the {@code "glob"} pattern.
+     *
+     * <p>
      * The default implementation returns an empty list, which means to apply 
a language-dependent pattern.
      * For example, for the Java language, the pattern includes all files with 
the {@code .java} suffix.
      */
-    default List<PathMatcher> includes() {
+    default List<String> includes() {
         return List.of();
     }
 
     /**
-     * {@return the list of pattern matchers for the files to exclude}.
+     * {@return the list of patterns for the files to exclude}.
      * The exclusions are applied after the inclusions.
      * The default implementation returns an empty list.
      */
-    default List<PathMatcher> excludes() {
+    default List<String> excludes() {
         return List.of();
     }
 
+    /**
+     * {@return a matcher combining the include and exclude patterns}.
+     * The matcher is absent if the includes/excludes lists are empty
+     * and {@code useDefaultExcludes} is {@code false}.
+     *
+     * @param useDefaultExcludes whether to add the default set of patterns to 
exclude,
+     *        mostly Source Code Management (<abbr>SCM</abbr>) files
+     */
+    Optional<PathMatcher> matcher(boolean useDefaultExcludes);

Review Comment:
   It would rather be a matcher that include everything. I had an hesitation on 
that one. The current rational is that `java.nio.Files` often returns 
`Stream<Path>`, in which case the matcher can be applied by a call to 
`stream.filter((path) -> pm.matches(path))`. If the `Optional` is empty, we can 
omit the call to `filter` completely. I'm not sure if it makes a big 
performance difference in practice however.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to