-
Notifications
You must be signed in to change notification settings - Fork 0
KMP multi-module integration test #8
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: master
Are you sure you want to change the base?
KMP multi-module integration test #8
Conversation
which fails because Wire doesn't support adding resources to kmp modules
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.
PR Summary
This PR introduces Kotlin Multiplatform (KMP) multi-module integration for the Wire Gradle plugin, enhancing its flexibility and compatibility with various project structures.
- Added support for KMP in
WirePlugin.kt, improving handling of different Kotlin project types and source sets - Introduced new sample projects demonstrating Android multi-module and multi-platform multi-module setups
- Modified
WireExtension.ktto include Android and Kotlin-specific configurations for better KMP compatibility - Updated
settings.gradle.ktsto include new sample projects and comment out older ones - Added Proto files for dinosaurs, geology, and location modules, showcasing inter-module dependencies in KMP context
18 file(s) reviewed, 16 comment(s)
Edit PR Review Bot Settings
| buildscript { | ||
| repositories { | ||
| mavenCentral() | ||
| google() | ||
| } | ||
| dependencies { | ||
| classpath(libs.pluginz.android) | ||
| classpath("com.squareup.wire:wire-gradle-plugin") | ||
| } | ||
| } |
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.
style: Consider moving buildscript block to the root project's build.gradle.kts for better organization
| optional double length_meters = 3; | ||
| optional double mass_kilograms = 4; |
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.
style: Consider adding units to field names for clarity, e.g., 'length_meters' to 'length_in_meters'
| android { | ||
| namespace = "com.squareup.wire.android.app.multi.geology" | ||
| } |
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.
style: Add compileSdk, defaultConfig, and other necessary Android configurations
| kotlin { | ||
| } |
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.
style: Specify Android-specific options for Wire's Kotlin configuration
| classpath(libs.pluginz.android) | ||
| classpath("com.squareup.wire:wire-gradle-plugin") |
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.
style: Consider using a version catalog for the Wire Gradle plugin dependency
| optional double length_meters = 3; | ||
| optional double mass_kilograms = 4; |
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.
style: Add units to field names for clarity.
| val hostOs = System.getProperty("os.name") | ||
| val isMingwX64 = hostOs.startsWith("Windows") | ||
| val nativeTarget = when { | ||
| hostOs == "Mac OS X" -> macosX64("native") |
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.
style: Consider using 'macos' instead of 'Mac OS X' for broader compatibility with newer macOS versions
|
|
||
| package squareup.location; | ||
|
|
||
| option java_package = "com.squareup.location"; |
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.
logic: java_package option is set, but this is a JS module. Verify if this option is necessary or if it should be changed to a JS-specific option.
| // include(":wire-benchmarks") | ||
| // include(":wire-golden-files") | ||
| // include(":wire-gradle-plugin-playground") | ||
| // include(":wire-grpc-tests") | ||
| // include(":wire-protoc-compatibility-tests") |
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.
style: Some modules are commented out here but included earlier in the file. Check if this is intentional or if it might cause confusion.
| } | ||
| } else { | ||
| project.logger.warn("${project.displayName} doesn't have a 'main' source sets. The .proto files will not automatically be added to the artifact.") | ||
| (project.extensions.getByName("kotlin") as? KotlinProjectExtension)?.sourceSets |
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.
logic: This line appears to be incomplete or unnecessary. Consider removing or completing the logic.
No description provided.