rouzwawi / grpc-kotlin

gRPC with Kotlin Coroutines
https://gitter.im/gRPC-Kotlin/Lobby
Apache License 2.0
219 stars 22 forks source link

Cannot use plugin on Linux #1

Closed rocketraman closed 6 years ago

rocketraman commented 6 years ago

On Linux, I get the following error when running a gradle build with the grpc-kotlin plugin:

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':protobufToolsLocator_grpckotlin'.
> Could not find grpc-kotlin-gen-linux-x86_64.exe (io.rouz:grpc-kotlin-gen:0.0.1).
  Searched in the following locations:
      https://nexus.example.com/repository/maven-public/io/rouz/grpc-kotlin-gen/0.0.1/grpc-kotlin-gen-0.0.1-linux-x86_64.exe
rouzwawi commented 6 years ago

Hi @rocketraman. Sorry for missing your issue. Could you please supply some details about your build setup so I can try to reproduce this.

It looks like it’s looking for a platform specific artifact while the plugin is a java binary, so it should not need to be downloaded with a linux-x86_64 classifier.

rocketraman commented 6 years ago

@rouzwawi Thanks. My build setup is:

Gradle 4.6 Protobuf 3.5.1 gRPC 1.12.0 Kotlin 1.2.50

with the Protobuf gradle plugin 0.8.5.

HTH!

powturns commented 6 years ago

I got this working by rebuilding the artifact and posting it to a maven repository on a nexus server.

The trick was to specify jdk8 as the classifier so the protobuf gradle plugin could resolve it. The other thing that had to happen was making the jar file executable from linux, which involves adding a preamble to it.

So in consuming projects, the include became:

grpckotlin {
            artifact = "kotlin:grpc-kotlin-gen:0.0.2:jdk8@jar"
        }
rouzwawi commented 6 years ago

@51systems thanks for the hint! I didn't know about this difference between the Gradle and Maven plugins. The linked PR should resolve this for Gradle on unix-like systems now.

rouzwawi commented 6 years ago

Version 0.0.2 is now released and should be usable like

grpckotlin {
    artifact = "io.rouz:grpc-kotlin-gen:0.0.2:jdk8@jar"
}
rocketraman commented 6 years ago

Thank you!