-
Notifications
You must be signed in to change notification settings - Fork 187
chore: build logic conventions #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: build logic conventions #290
Conversation
📝 WalkthroughWalkthroughIntroduces a new Gradle build-logic module that extracts the duplicated Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to 0ac9ae8 in 1 minute and 6 seconds. Click for details.
- Reviewed
177lines of code in7files - Skipped
0files when reviewing. - Skipped posting
7draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. sdk/runanywhere-kotlin/build-logic/build.gradle.kts:6
- Draft comment:
Kotlin DSL and reproducibility config look good. Consider parameterizing 'allWarningsAsErrors' if flexibility is needed. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
2. sdk/runanywhere-kotlin/build-logic/settings.gradle.kts:1
- Draft comment:
Settings file correctly sets the root project name and repositories for dependency resolution. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. sdk/runanywhere-kotlin/build-logic/src/main/kotlin/runanywhere.conventions.gradle.kts:30
- Draft comment:
The shared 'resolveModulePath' function is cleanly extracted with clear documentation and proper fallbacks. This centralizes the module path logic. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. sdk/runanywhere-kotlin/build.gradle.kts:11
- Draft comment:
Removal of the local module path resolution function in favor of applying the 'runanywhere.conventions' plugin simplifies composite build configuration. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. sdk/runanywhere-kotlin/modules/runanywhere-core-llamacpp/build.gradle.kts:25
- Draft comment:
Consistently applying the 'runanywhere.conventions' plugin improves maintainability by centralizing module path resolution. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. sdk/runanywhere-kotlin/modules/runanywhere-core-onnx/build.gradle.kts:7
- Draft comment:
Applying the 'runanywhere.conventions' plugin to the ONNX module removes duplication and ensures consistent module path resolution. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. sdk/runanywhere-kotlin/settings.gradle.kts:1
- Draft comment:
Including the 'build-logic' build in pluginManagement ensures the shared conventions plugin is accessible across modules. The module inclusions for backends are also correctly configured. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_Z6sqWKjdLdQ83Aud
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
Hey Dude , review my PR before making one, cause i have also made some changes in build system |
|
@coderabbitai please review |
|
@greptile please review |
|
🧠 Learnings used✅ Actions performedReview triggered.
|
sorry just saw this |
Description
Closes #215
Type of Change
Testing
Platform-Specific Testing (check all that apply)
Swift SDK / iOS Sample:
Kotlin SDK / Android Sample:
Flutter SDK / Flutter Sample:
React Native SDK / React Native Sample:
Labels
Please add the appropriate label(s):
SDKs:
Swift SDK- Changes to Swift SDK (sdk/runanywhere-swift)Kotlin SDK- Changes to Kotlin SDK (sdk/runanywhere-kotlin)Flutter SDK- Changes to Flutter SDK (sdk/runanywhere-flutter)React Native SDK- Changes to React Native SDK (sdk/runanywhere-react-native)Commons- Changes to shared native code (sdk/runanywhere-commons)Sample Apps:
iOS Sample- Changes to iOS example app (examples/ios)Android Sample- Changes to Android example app (examples/android)Flutter Sample- Changes to Flutter example app (examples/flutter)React Native Sample- Changes to React Native example app (examples/react-native)Checklist
Screenshots
Attach relevant UI screenshots for changes (if applicable):
Important
Refactor Kotlin SDK build scripts by introducing shared build logic and conventions in a new
build-logicdirectory.build-logicdirectory withbuild.gradle.kts,settings.gradle.kts, andrunanywhere.conventions.gradle.ktsfor shared build utilities.resolveModulePath()function inrunanywhere.conventions.gradle.ktsfor module path resolution.runanywhere.conventionsplugin inbuild.gradle.ktsofrunanywhere-kotlin,runanywhere-core-llamacpp, andrunanywhere-core-onnx.resolveModulePath()function frombuild.gradle.ktsinrunanywhere-kotlinand delegates torunanywhere.conventionsplugin.settings.gradle.ktsto includebuild-logicfor convention plugins.This description was created by
for 0ac9ae8. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Greptile Summary
This PR successfully extracts shared Gradle build conventions into a new
build-logicplugin, eliminating code duplication of theresolveModulePath()function across Kotlin SDK modules. The implementation introduces a clean, reusable convention plugin that handles module path resolution for composite builds, reducing maintenance burden and ensuring consistent behavior across all backend modules.Key Changes:
build-logicplugin infrastructure with proper settings and gradle-dsl configurationrunanywhere.conventionsGradle plugin withresolveModulePath()extension function that handles multiple composite build scenariosresolveModulePath()implementation from main SDK build.gradle.kts (47 lines eliminated)Benefits:
Confidence Score: 5/5
Important Files Changed
resolveModulePath()extension function. Implements robust module path resolution handling multiple composite build scenarios. Logic is correct and well-documented with clear fallback behavior.runanywhere.conventionsplugin (line 11). Removed 47 lines ofresolveModulePath()function implementation and replaced with comment directing to convention plugin. No functional changes—pure refactoring.runanywhere.conventionsplugin (line 25). Backend module now reuses shared build logic. No other changes.runanywhere.conventionsplugin (line 29). Backend module now reuses shared build logic. No other changes.pluginManagementblock to include build-logic (line 3). Enables convention plugins for all modules. Configuration correct and matches Gradle composite build best practices.Sequence Diagram
sequenceDiagram participant Settings as settings.gradle.kts participant BuildLogic as build-logic Plugin participant Convention as runanywhere.conventions participant MainBuild as Main SDK Build participant BackendBuild as Backend Modules Build Settings->>BuildLogic: includeBuild("build-logic") BuildLogic->>Convention: Registers convention plugin Convention->>Convention: Defines resolveModulePath() MainBuild->>Convention: applies id("runanywhere.conventions") Convention->>MainBuild: Provides resolveModulePath() extension BackendBuild->>Convention: applies id("runanywhere.conventions") Convention->>BackendBuild: Provides resolveModulePath() extension MainBuild->>MainBuild: Uses resolveModulePath("core-llamacpp") BackendBuild->>BackendBuild: Can also use resolveModulePath() if needed Convention->>Convention: Resolves paths for composite builds<br/>(SDK as root or subproject)