Hi all,I made available a Gradle Kotlin plugin, allowing to compile Kotlin code and tests using Gradle. Put your Kotlin sources in "src/main/kotlin", tests in "src/test/kotlin", add the code below to your Gradle build and run "gradle compileKotlin compileTestKotlin build" ("build" dependency on Kotlin tasks will be added later).
The plugin is in snapshot version right now. The release will be made for the next Kotlin milestone. If you can try it out till then and let me know of any issues that would help us to have it in a stable form before the first release.
What went wrong:
A problem occurred evaluating root project ‘Test’.
> No such property: runtime for class: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
I'm using Gradle 1.1, maybe you develop on a different version?
Digging a bit in your repo, I saw you’re using M1. Won’t be better to go with M2?
Hi,Can you paste your Gradle script here so it'll be possible to see where exactly the error was thrown?I'm using Gradle 1.1 and Kotlin 0.1-SNAPSHOT, that's a daily snapshot, not a milestone. Once M3 will be released the plugin version 0.1.4 will depend on it. What makes you think M1 is used?
I saw that version referred as M1 on this site, but maybe I made a mistake, I don't remember well...
I thought that version, released on may, was M1 and version 0.1.2580, released on june, is M2.
Anyway, the gradle script is identical to your example:
When using the plugin, I'm getting some errors like this:
Type mismatch: inferred type is jet.String? but jet.String was expected
When calling some Java APIs. This despite the fact that within IntelliJ, things compile fine. I assume that this is because the compiler isn’t using the latest version of kotlin that has some information about standard java APIs, and which return nullable results.
Is this the case? Is there any way to have a plugin that uses a later version of the runtime?
Good, thanks! Jon, the example below adds the "kotlin-jdk-annotations" to the compilation classpath, please post here any further problems you may experience.
I have the problem, that the java packages javax.crypto.* cannot be found. Other java packages are ok. I guess there is some issue with the sourceCompatibility version. Here is my build.gradle