Skip to content
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

Sample wanted for square/wire #8

Open
jmfayard opened this issue Sep 30, 2020 · 13 comments · May be fixed by #84
Open

Sample wanted for square/wire #8

jmfayard opened this issue Sep 30, 2020 · 13 comments · May be fixed by #84
Labels

Comments

@jmfayard
Copy link
Collaborator

About the library

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!
@sijanr
Copy link

sijanr commented Oct 4, 2020

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:

@jmfayard
Copy link
Collaborator Author

jmfayard commented Oct 5, 2020

@sijanr
One get this error when no plugin version is set
add manually to versions.properties this:
plugin.com.squareup.wire=3.4.0

@jmfayard
Copy link
Collaborator Author

jmfayard commented Oct 5, 2020

Should I assign the issue to you?

@sijanr
Copy link

sijanr commented Oct 5, 2020

Yes, that'd be great. Thanks!

@sijanr
Copy link

sijanr commented Oct 7, 2020

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"
}
}

@LouisCAD
Copy link
Owner

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.

@sijanr
Copy link

sijanr commented Oct 24, 2020

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?

@jmfayard
Copy link
Collaborator Author

Can you push your code and open a pull request in its present state? I will try to fix it

@LouisCAD
Copy link
Owner

LouisCAD commented Oct 24, 2020

@sijanr pluginManagement is meant for the settings.gradle.kts file.

@LouisCAD
Copy link
Owner

Also, please use triple backticks for code snippets.

Like this

sijanr added a commit to sijanr/kotlin-libraries-playground that referenced this issue Oct 30, 2020
@sijanr sijanr linked a pull request Oct 30, 2020 that will close this issue
2 tasks
@sijanr
Copy link

sijanr commented Oct 30, 2020

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 {}
}

@sijanr
Copy link

sijanr commented Oct 30, 2020

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"
}

@jmfayard
Copy link
Collaborator Author

ok, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants