kotlinx.html
kotlinx.html copied to clipboard
Gradle code on getting started page is out of date
Using Gradle 3.0, Kotlin 1.0.3, and the following build.gradle file, I get a compilation error:
Could not find method compileClient() for arguments [org.jetbrains.kotlinx:kotlinx.html.js:0.5.10] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
I get a different error if using "${kotlinx.html.version}" in place of the version number:
Could not get unknown property 'kotlinx' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
What I did get to work properly was calling the compile method on the js version of the library, but I doubt that the behavior is intended.
buildscript {
ext.kotlin_version = '1.0.3'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
maven {
url "http://dl.bintray.com/kotlinx/kotlinx"
}
}
dependencies {
compile "org.jetbrains.kotlinx:kotlinx.html.jvm:0.5.10"
compileClient "org.jetbrains.kotlinx:kotlinx.html.js:0.5.10"
}
For sure it's not a complete gradle script, it's just a snippet. You have to put your version instead or declare your own property. Perhaps I have to make it more clear?
I would find some additional clarity helpful, yes, even if it's a two line addition to the top of the snippet.
//Fill this in with the version of kotlinx in use in your project
def kotlinx_html_version = [your_version_here]
I found that using kotlinx.html.version did not work properly, and so replaced the periods with underscores.
Is there something that I'm missing about gradle or kotlinx?
Any input on the compileClient method being missing? Using compile alone works without error.
Let me check about compileClient
. As far as I remember it was helpful to do like that when you have client and server side in the same module. Perhaps it is broken now.