Skip to content

Conversation

@lizard-boy
Copy link

No description provided.

oldergod added 2 commits July 2, 2024 13:47
which fails because Wire doesn't support adding resources to kmp modules
Copy link

@greptile-apps greptile-apps bot left a 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.kt to include Android and Kotlin-specific configurations for better KMP compatibility
  • Updated settings.gradle.kts to 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

Comment on lines +7 to +16
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath(libs.pluginz.android)
classpath("com.squareup.wire:wire-gradle-plugin")
}
}
Copy link

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

Comment on lines +17 to +18
optional double length_meters = 3;
optional double mass_kilograms = 4;
Copy link

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'

Comment on lines +18 to +20
android {
namespace = "com.squareup.wire.android.app.multi.geology"
}
Copy link

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

Comment on lines +32 to +33
kotlin {
}
Copy link

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

Comment on lines +14 to +15
classpath(libs.pluginz.android)
classpath("com.squareup.wire:wire-gradle-plugin")
Copy link

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

Comment on lines +17 to +18
optional double length_meters = 3;
optional double mass_kilograms = 4;
Copy link

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")
Copy link

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";
Copy link

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.

Comment on lines +92 to +96
// include(":wire-benchmarks")
// include(":wire-golden-files")
// include(":wire-gradle-plugin-playground")
// include(":wire-grpc-tests")
// include(":wire-protoc-compatibility-tests")
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants