Skip to content

Commit 3a2df08

Browse files
Update in-repo api dependency when releasing the api (#310)
## Description `./release.sh api` only bumped the version in `liquidjava-api/pom.xml`. The verifier and example kept depending on the previous api version until someone updated them by hand (as happened in the 0.0.7 release). The api release commit now also bumps the `liquidjava-api` dependency in `liquidjava-verifier/pom.xml` and `liquidjava-example/pom.xml`. The verifier release path is unchanged. This replaces #309: this repo doesn't need Dependabot for its own api, since the release script now keeps the modules in sync. ## Example ``` ./release.sh api 0.0.8 # Release liquidjava-api 0.0.8 # liquidjava-api/pom.xml | 2 +- # liquidjava-example/pom.xml | 2 +- # liquidjava-verifier/pom.xml | 2 +- ``` ## Related Issue #309 ## Type of change - [x] Bug fix - [ ] New feature - [ ] Documentation update - [ ] Code refactoring ## Checklist - [ ] Added/updated tests under `liquidjava-example/src/main/java/testSuite/` (`Correct*` / `Error*`) (n/a, script change) - [x] `mvn test` passes locally - [ ] Updated docs/README if behavior or API changed (n/a) ## Testing Ran the patched script in a throwaway clone with a local bare repo as `origin`: - `./release.sh api 0.0.8`: one commit bumps all three poms, tags `api-v0.0.8`, pushes. - Root `mvn clean install` with api 0.0.8 not published anywhere: builds, resolving the api from the reactor (as CI does). - `./release.sh verifier 0.0.36`: unchanged, only the verifier pom is committed; 338 tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8816186 commit 3a2df08

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎release.sh‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,17 @@ if git diff --quiet -- "$POM"; then
9393
exit 1
9494
fi
9595

96+
RELEASE_FILES=("$POM")
97+
98+
# keep in-repo modules on the api version being released
99+
if [ "$MODULE" = "api" ]; then
100+
DEPENDENT_POMS=(liquidjava-verifier/pom.xml liquidjava-example/pom.xml)
101+
perl -0pi -e "s#(<artifactId>liquidjava-api</artifactId>\\s*<version>)[^<]+(</version>)#\${1}$VERSION\${2}#" "${DEPENDENT_POMS[@]}"
102+
RELEASE_FILES+=("${DEPENDENT_POMS[@]}")
103+
fi
104+
96105
# publish release tag
97-
git add "$POM"
106+
git add "${RELEASE_FILES[@]}"
98107
git commit -m "Release $MODULE_DIR $VERSION"
99108
git tag "$TAG"
100109

0 commit comments

Comments
 (0)