feat: add --incremental flag to skip up-to-date page object generation - #243
Open
intermezzio wants to merge 1 commit into
Open
feat: add --incremental flag to skip up-to-date page object generation#243intermezzio wants to merge 1 commit into
intermezzio wants to merge 1 commit into
Conversation
|
Thanks for the contribution! Unfortunately we can't verify the commit author(s): Andrew Mascillaro <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request. |
intermezzio
force-pushed
the
ajgm/only-generate-updated-files
branch
from
June 11, 2026 17:11
4b30990 to
7582172
Compare
|
Thanks for the contribution! Before we can merge this, we need @intermezzio to sign the Salesforce Inc. Contributor License Agreement. |
intermezzio
marked this pull request as ready for review
June 11, 2026 17:28
Introduces an opt-in --incremental (-I) CLI flag and JsonCompilerConfig constructor parameter that causes the compiler to skip generation for page objects whose generated .java artifacts are newer than their source .utam.json. TranslatorTargetConfig gains a default isUpToDate() method (returns false to preserve behavior for downstream custom configs); DefaultTargetConfiguration overrides it with a per-page-object timestamp check, and DefaultTranslatorRunner.write() consults it before invoking the (expensive) google-java-format pass.
intermezzio
force-pushed
the
ajgm/only-generate-updated-files
branch
from
June 11, 2026 19:15
7582172 to
306b66a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #244
Summary
--incremental(-I) CLI flag (and matchingJsonCompilerConfigconstructor parameter) that causes the compiler to skip generation for page objects whose generated.javaartifacts are newer than the source.utam.json.TranslatorTargetConfig.isUpToDate(...)interface method with a defaultreturn false, preserving behavior for downstream custom target configs.DefaultTargetConfigurationoverridesisUpToDatewith a per-page-object timestamp check (interface and impl.javapaths must exist and be ≥ source mtime; impl-only POs only require the impl artifact).DefaultTranslatorRunner.write()consultsisUpToDatebefore invokinggetGeneratedCode()(which is wheregoogle-java-formatruns) and skips the interface, class, JSON resource, and unit-test writes for that PO. Aggregate outputs (manifest, dependency-injection config) still cover every PO.Motivation
When this library is consumed via the compiler plugin in a downstream project,
mvntriggers an all-or-nothing rebuild on every invocation, withgoogle-java-formatdominating the cost. Incremental mode skips the formatter and file writes for page objects whose targets are already current, which is a large speedup on iterative dev loops.Behavior
--incremental: a PO is skipped iff its generated targets exist and have mtime ≥ the source.utam.jsonmtime. Any missing or older target forces regeneration. Source mtime ≤ 0 also forces regeneration (matters for unit tests with synthetic sources).Test plan
DefaultTargetConfigurationTestscoveringisUpToDatefor: flag off, source mtime zero, missing interface file, missing class file, source newer than targets, targets newer than source, interface-only PO, impl-only PO.DefaultTranslatorRunnerTestsverifyingwrite()skips all POs when target reports up-to-date and writes only the out-of-date PO when the target is selective.JsonCompilerConfigTestsverifying the 4-arg constructor wires the incremental flag through to the resultingTranslatorTargetConfig.mvn -pl utam-compiler test— 644/644 pass.mvn -pl utam-core test— 385/385 pass.mvn spotless:checkclean.