gnodet opened a new pull request, #1154:
URL: https://github.com/apache/maven-compiler-plugin/pull/1154

   ## Summary
   
   Adds a `graph` incremental compilation strategy that tracks class-level 
dependencies via bytecode analysis and recompiles only the transitive consumers 
of changed classes.
   
   **Depends on: #1153** (MRJAR bytecode analyzer infrastructure)
   
   ## What this PR adds
   
   ### New classes
   
   - **`SourceFileAnalysis`** — per-type analysis record (without ABI 
fingerprint — see PR C for that)
   - **`IncrementalState`** — binary-serialized per-build state (VERSION=2): 
source content hashes, last-modified times (mtime optimization), class-level 
dependency graph, classpath identities, config hash; maintained with inverted 
consumer indices for O(1) cascade lookup
   - **`AbiIncrementalBuild`** — incremental build engine:
     - `initialize()`: loads previous state, hashes sources (mtime-first 
optimization), determines what needs compilation
     - `processCompiledClasses()`: scans fresh `.class` files, updates dep 
graph, cascades to all consumers (any change cascades — body changes, API 
changes, all)
     - `finish()`: persists state as `.incremental-state` in 
`target/maven-status/maven-compiler-plugin/`
   - **`ProcessorClassification`** / **`ProcessorType`** — annotation processor 
cascade classification (ISOLATING/AGGREGATING/UNKNOWN) via 
`META-INF/maven/compiler/incremental.annotation.processors`
   
   ### Build wiring
   
   - `AbstractCompilerMojo`: adds `incrementalStrategy` parameter (`timestamp` 
default, `graph` opt-in); restored correct `amendincrementalCompilation` with 
`proc`/RELEASE_23 logic
   - `ToolExecutor`: `compileWithAbiIncremental()` drives the `graph` strategy 
(no cross-module ABI resolver needed)
   - `ToolExecutorForTest`: override for test harness
   
   ### Integration tests
   
   - `abi-incremental-basic`: verifies incremental detection and state 
persistence
   - `abi-incremental-cascade`: verifies cascade on class change
   
   ## Key differences from ABI strategy (PR C)
   
   | | graph (this PR) | abi (PR C) |
   |---|---|---|
   | Body-only changes | cascade | no cascade |
   | Cross-module tracking | classpath identity (jar hash) | ABI fingerprint 
manifest |
   | State format | VERSION=2, no fingerprint field | VERSION=3, with 
fingerprint |
   | Requires | JDK 24+ (BytecodeAnalyzer) | JDK 24+ |
   
   ## Tests
   
   86 tests passing (0 regressions vs master).
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to