Skip to content

Commit

Permalink
Added module-info.java filter prior to Java 8 compilation (Vertispan#258
Browse files Browse the repository at this point in the history
)
  • Loading branch information
salmonb authored Apr 10, 2024
1 parent 4b64140 commit 1108fc9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class BytecodeTask extends TaskFactory {
public static final PathMatcher JAVA_SOURCES = withSuffix(".java");
public static final PathMatcher JAVA_BYTECODE = withSuffix(".class");
public static final PathMatcher NOT_BYTECODE = p -> !JAVA_BYTECODE.matches(p);
public static final PathMatcher JAVA_MODULE_INFO = withSuffix("module-info.java");
public static final PathMatcher JAVA_SOURCES_EXCEPT_MODULE_INFO = p -> JAVA_SOURCES.matches(p) && !JAVA_MODULE_INFO.matches(p);

public static final PathMatcher APT_PROCESSOR = p ->
p.equals(Paths.get("META-INF", "services", "javax.annotation.processing.Processor"));
Expand Down Expand Up @@ -88,8 +90,8 @@ public Task resolve(Project project, Config config) {
// TODO just use one input for both of these
// track the dirs (with all file changes) so that APT can see things it wants
Input inputDirs = input(project, OutputTypes.INPUT_SOURCES);
// track just java files (so we can just compile them)
Input inputSources = input(project, OutputTypes.INPUT_SOURCES).filter(JAVA_SOURCES);
// track just java files (so we can just compile them), ignoring module-info.java files (as they make javac 8 fail)
Input inputSources = input(project, OutputTypes.INPUT_SOURCES).filter(JAVA_SOURCES_EXCEPT_MODULE_INFO);
// track resources so they are available to downstream processors on the classpath, as they would
// be if we had built a jar
Input resources = input(project, OutputTypes.INPUT_SOURCES).filter(NOT_BYTECODE);
Expand Down

0 comments on commit 1108fc9

Please sign in to comment.