docs(skill): record jvmmodel-batch learnings in xtend-to-java - #1540
Conversation
11b0dfb to
8314d0c
Compare
| Do not split the translate step per file — every intermediate commit before the last file | ||
| would be broken anyway, so per-file translate commits only multiply the broken range. | ||
|
|
||
| ## Tycho baseline bump |
There was a problem hiding this comment.
I would not add this, as it is different for downstream projects
There was a problem hiding this comment.
Agreed. The section now applies only when the build runs the baseline check, and names no DDK modules.
🤖 Drafted with Claude Code
| After every batch: | ||
|
|
||
| 1. **Compile gate**: `mvn -pl :<module> -am -DskipTests compile -f ./ddk-parent/pom.xml` — must pass. | ||
| 1. **Compile gate**: `mvn -pl :ddk-target,:<module> -am -DskipTests compile -f ./ddk-parent/pom.xml` — must pass. |
There was a problem hiding this comment.
I would not add this, as it is different for downstream projects
There was a problem hiding this comment.
Agreed, replaced with generic placeholders.
🤖 Drafted with Claude Code
| 2. **Test gate**: `mvn verify -f ./ddk-parent/pom.xml --batch-mode --fail-at-end` — must pass. | ||
| 3. **Static analysis gate**: `mvn checkstyle:check pmd:check spotbugs:check -f ./ddk-parent/pom.xml` — must pass. | ||
|
|
||
| `:ddk-target` must be in every `-pl` list — the target artifact is not in `~/.m2`. Before the first |
There was a problem hiding this comment.
I would not add this, as it is different for downstream projects
There was a problem hiding this comment.
Agreed, now phrased as a generic Tycho rule.
🤖 Drafted with Claude Code
| 9. **Verify the file compiles:** | ||
| ```bash | ||
| mvn -pl :<module> -am -DskipTests compile -f ./ddk-parent/pom.xml > mvn-output.txt 2>&1 | ||
| mvn -pl :ddk-target,:<module> -am -DskipTests compile -f ./ddk-parent/pom.xml > mvn-output.txt 2>&1 |
There was a problem hiding this comment.
probably this and the others need to be more generic so that it is not so tied with DDK naming, don't you think?
There was a problem hiding this comment.
Agreed. I went through the whole skill: no DDK-specific names are left apart from the @Tag section, which only applies to projects using the DDK test framework.
🤖 Drafted with Claude Code
8314d0c to
411e777
Compare
Learned migrating the ten jvmmodel files (expression, export, scope), written so the skill applies to any Eclipse/Tycho/Xtext repository: commands use <parent-pom> and <target-module> placeholders, and repository conventions (license header, shared JDT settings) are taken from the repository itself. 1. Tier 4 stays on the reference StringConcatenation chain when it has newLineIfNotEmpty after a dynamic value, two-arg append of a possibly multi-line value, appendImmediate, or a StringConcatenationClient value; append(null) appends nothing, so a nullable String moved into .formatted() wraps in Strings.emptyIfNull and other nullable values in Objects.toString(value, ""). 2. JvmTypeReferenceBuilder.typeRef is provably non-null; to* builders with a nullable name stay guarded. 3. Dispatcher case order comes from xtend-gen, not source order; the terminal else-throw stays, Java's definite-return analysis needs it. 4. Checkstyle JavadocMethod vs rule 1: complete missing @PARAM tags from a sibling overload; move dispatch Javadoc off the Void overload. 5. xbase.lib types stay in public signatures and callee-demanded callbacks. 6. BooleanExpressionComplexity vs SimplifyBooleanReturns: guard clauses or a named local, never a suppression. 7. PMD StringToString: Integer.toString(x) is neutral; dropping toString() on a String needs a non-null proof, else Objects.requireNonNull. 8. Module-scoped gate commands must include the target-platform module; clear the stale xtend-gen output before the first compile; diff -r -x '.*' for the freshness check. 9. If the reactor runs compare-version-with-baselines (tycho-p2-extras-plugin): separate build: bump commit; features and category only when they also equal the baseline; the sources artifact is compared. 10. .project Xtext builder/nature stay only while the module still has Xtext-language resources; otherwise they were Xtend's and go. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
411e777 to
ea936bb
Compare
Records in the
xtend-to-javaskill what the final jvmmodel batch (#1536) taught, and makes the skill repository-agnostic so it can be reused in other Eclipse/Tycho/Xtext projects: commands use<parent-pom>/<target-module>placeholders, and repository conventions (license header, shared JDT settings) come from the repository itself. Documentation only; no code.StringConcatenationchain when they carrynewLineIfNotEmpty()after a dynamic value, a two-argument indented append of a possibly multi-line value,appendImmediate, or aStringConcatenationClientvalue.append(null)appends nothing, so a nullableStringmoved into.formatted()wraps inStrings.emptyIfNull, other nullable values inObjects.toString(value, "").JvmTypeReferenceBuilder.typeRefis provably non-null;to*builders with a nullable name stay guarded.xtend-gen, never from source order; the terminal else-throw stays.JavadocMethodvs "never invent Javadoc": complete the missing tag from a sibling overload.xbase.libtypes stay in public signatures and callee-demanded callbacks.BooleanExpressionComplexityvsSimplifyBooleanReturns: guard clauses or a named local, no suppression.StringToString:Integer.toString(x)is neutral; droppingtoString()on aStringneeds a non-null proof, otherwiseObjects.requireNonNull.xtend-genoutput before the first compile;diff -r -x '.*'for the freshness check.compare-version-with-baselines(tycho-p2-extras-plugin): a separatebuild:bump commit for the bundle, then features and update site only where they also equal the baseline..projectXtext builder/nature stay only while the module still has Xtext-language resources; otherwise they were Xtend's and go.🤖 Generated with Claude Code