Optimize build: share OpenAPI generator JAR across client modules#419
Merged
jiang95-dev merged 1 commit intolinkedin:mainfrom Jan 15, 2026
Merged
Conversation
Collaborator
|
Thanks, the script is great and bulletproof! However, I think there's an alternative without using locks. We can make the setup() task only in :client:common (of course the folder must be shared), and then the clientCodeGen() task in each module to depend on the setup() task. Right now we are bringing the setup() task in each module so that's why it is executed multiple times. I think this will be more efficient since we don't need locks or temp files copy. |
Instead of file locking in shell script, move setUp task to :client:common and have each module's clientCodeGen depend on :client:common:setUp. This leverages Gradle's built-in task ordering - simpler and more efficient. Changes: - Add client/common/build.gradle with single setUp task - Update codegen.build.gradle to depend on :client:common:setUp - Simplify jar_download.sh (no locking needed)
64759d7 to
7efb046
Compare
jiang95-dev
approved these changes
Jan 15, 2026
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.
Summary
Share OpenAPI generator JAR across client modules to reduce build time by 10%.
Previously, each client module (
hts,tableclient,jobsclient) downloaded the OpenAPI generator CLI JAR (~24MB) to its own$buildDir/bindirectory. This change uses a shared location with file locking to ensure only one download occurs.Build time improvement (
./gradlew clean build -x test):Changes
Performance Improvements
client/common/codegen.build.gradleto use shared JAR location (${rootProject.buildDir}/openapi-cli)client/common/jar_download.shwith:mkdir(works on Linux/macOS)mvto final locationBefore (3 separate downloads):
After (1 shared download):
Testing Done
Manual Testing
./gradlew clean build -x testNo Tests Added
This is a build infrastructure change that doesn't affect runtime behavior. The optimization is validated by the build output showing "exists" messages for subsequent client modules.
Additional Information
🤖 Generated with Claude Code