Skip to content

feat(base-compile-testing): javac testing harness#86

Merged
deer merged 1 commit into
mainfrom
compile_testing
Jun 10, 2026
Merged

feat(base-compile-testing): javac testing harness#86
deer merged 1 commit into
mainfrom
compile_testing

Conversation

@deer

@deer deer commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Introduces base-compile-testing, a JPMS-native replacement for google/compile-testing. The module provides a zero-dependency, in-memory javac harness for testing annotation processors and compiler-driven tooling.

API

  • Compiler — immutable fluent builder wrapping javax.tools.JavaCompiler; supports withProcessors, withOptions, withClasspath, and withModulePath (a gap in Google's library)
  • Compilation — Java record holding the compilation result: status, diagnostics (with errors(), warnings(), notes() stream accessors), and the full list of generated files with lookup helpers generatedSourceFile(String) and generatedFile(Location, String, String)
  • JavaFileObjects — factory for in-memory source files via forSourceString and forSourceLines
  • InMemoryJavaFileManager / ForwardingStandardJavaFileManager — internal plumbing that captures all compiler output in memory without touching the filesystem

Why not google/compile-testing? Google's library predates JPMS, pulls in Guava, and integrates with Truth rather than AssertJ. This module has no runtime dependencies beyond java.compiler, ships a proper module-info.java, and uses modern Java idioms throughout (records, Path-based paths, Writer.nullWriter() to suppress diagnostic noise on stderr).

@deer deer merged commit 8e3a7aa into main Jun 10, 2026
1 of 3 checks passed
@deer deer deleted the compile_testing branch June 10, 2026 09:17
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