You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clean up checker-qual module-info build configuration and avoid bare 'src/main' Eclipse workaround #2130
Setting srcDirs ('src/main') on module_info causes several drawbacks:
IDE classpath collision: Gradle's eclipse plugin registers src/main alongside src/main/java as source folders in checker-qual/.classpath. Eclipse and VS Code (Eclipse JDT LS) reject nested source folders without mutual exclusion filters, producing a build error (Cannot nest 'checker-qual/src/main/java' inside 'checker-qual/src/main').
To unblock IDEs, a workaround was added in root build.gradle (PR Improve VS Code and Eclipse support #1518) filtering out e.path == 'src/main' in eclipse.classpath.file.whenMerged.
Duplicate compilation: Because srcDirs ('src/main') covers all source files under src/main, sourceSets.module_info.java contains all 363 Java files in checker-qual. compileJava9 therefore compiles all annotations under --release 9 before compileJava overwrites them with Java 8 bytecode.
Task workarounds: Gradle creates auto-generated tasks for module_info (e.g., compileModule_infoJava), requiring workarounds like tasks.named('compileModule_infoJava') { enabled = false }.
Proposed Cleanups
Investigate cleaner alternatives to avoid generating the bare src/main source set and compiling the whole library twice:
Option 1 (Compile module-info.java directly): Remove sourceSets.module_info entirely. Register compileJava9 as a standalone task with source = files('src/main/java/module-info.java') and classpath pointing to sourceSets.main.output.classesDirs. This keeps module-info.java at src/main/java/module-info.java without moving files or introducing dummy source sets.
Option 2 (Relocate module-info.java): Move module-info.java to src/module_info/java/module-info.java (the default convention for sourceSets.module_info) or src/main/java9/module-info.java, avoiding nesting with src/main/java. Note trade-off: file divergence when merging from upstream typetools.
Option 3 (Localize Eclipse filter): If sourceSets.module_info is retained for upstream compatibility, localize the Eclipse entry removal to checker-qual/build.gradle rather than applying it globally in root build.gradle.
Activity
Reference issue eisop#2130 for permanent cleanup of src/main in Eclipse