Skip to content

Support source directory defaults and JDK module source paths - #28

Merged
DanielThomas merged 1 commit into
mainfrom
fix/jdk-source-selection
Oct 14, 2026
Merged

DanielThomas merged 1 commit into
mainfrom
fix/jdk-source-selection

Conversation

@DanielThomas

Copy link
Copy Markdown
Member

Changes

  • Use the JDK file manager for module source paths, including path lists, repeated module mappings, and multiple source roots and patterns for one module.
  • When no files or modules are selected, format Java files in the supplied source directories. Generated source directories are included when supplied.
  • Keep explicit file selection narrow. An explicit --module selects whole modules alongside any file operands, matching javac.
  • Use source archives for import resolution without rewriting them, and never select sources from binary paths.
  • Preserve syntax-only formatting for missing module dependencies, including explicit files and additional source roots.

No new options, interchange formats, documentation changes, or build-system-specific formatting logic.

Validation

  • Added regression tests before the fixes; observed failures for selection expansion, multiple roots, and default directory discovery.
  • ja test --all: 212 tests passed.
  • Assembled the updated tool successfully.
  • Tested real jig-generated argument files with no file operands: non-modular Maven, non-modular Gradle, and a Gradle module with two source roots and no --module selection. All --check invocations passed.

@DanielThomas
DanielThomas merged commit 9f06c5c into main Oct 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant