kotlin-libraries-playground
kotlin-libraries-playground copied to clipboard
Sample wanted for square/wire
About the library
- Description: gRPC and protocol buffers for Android, Kotlin, and Java.
- GitHub: https://github.com/square/wire
- Official website: https://square.github.io/wire/
What the sample could do
Re-use the Dinosaur
sample from the documentation
Wants to contribute the sample?
- Say so in a comment here
- Follow instructions in CONTRIBUTING.md
- Submit your pull request!
I'm currently trying out the library, but I'm unable to import wire's gradle plugin to the project. I tried to add the following in build.gradle.kts file
plugins { id 'application' id 'org.jetbrains.kotlin.jvm' id 'com.squareup.wire' }
wire { kotlin { } }
I get the error: Plugin [id: 'com.squareup.wire'] was not found in any of the following sources:
@sijanr
One get this error when no plugin version is set
add manually to versions.properties
this:
plugin.com.squareup.wire=3.4.0
Should I assign the issue to you?
Yes, that'd be great. Thanks!
I get the same error even after setting the plugin version, .
I added plugin.com.squareup.wire=3.4.0 to the version.properties file
In build.gradle.kts, I added: plugin { id("com.squareup.wire") }
wire { kotlin{ out "${buildDir}/generate" } }
It's because the wire plugin is not on the Gradle Plugins portal. You need to add gradlePluginPortal()
mavenCentral()
in the repos in the pluginManagement
in the settings.gradle.kts
file.
The build is successful, but I'm unable to add the following in the build.gradle.kts
wire { kotlin { } }
I don't think I can generate the kotlin class of the proto file without adding the above code.
Since applying the plugin directly in the build.gradle.pluginManagement { repositories { gradlePluginPortal() mavenCentral() } }kts wasn't working for me, I added plugin.com.squareup.wire=3.4.0 in the version.properties file.
I also added implementation ("com.squareup.wire:wire-runtime:3.4.0") to the dependencies in the build.gradle.kts file
Following your advice, I added
pluginManagement { repositories { gradlePluginPortal() mavenCentral() } }
to the settings.gradle.kts file. Is there anything that I did wrong?
Can you push your code and open a pull request in its present state? I will try to fix it
@sijanr pluginManagement
is meant for the settings.gradle.kts
file.
Also, please use triple backticks for code snippets.
Like this
This is what I've been able to get so far. You'll probably see a bunch of errors in the gradle build file, but it all clears out if you remove
wire {
kotlin {}
}
I also deleted the below code from the build.gradle.kts file because I just kept on receiving an error asking me remove it.
tasks.register("run", JavaExec::class.java) {
this.main = "playground._mainKt"
}
ok, thanks!