kartikpatodi
12/12/2017, 6:11 PMbamboo
12/12/2017, 6:12 PMplugins
block in that casenapperley
12/13/2017, 5:22 AMuser
12/13/2017, 5:28 AMif (requested.id.id.startsWith("org.jetbrains.kotlin.platform")) {
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
}
user
12/13/2017, 5:29 AMfun PluginResolveDetails.register(id: String, module: String) {
if (requested.id.id == id) {
useModule("$module:${requested.version}")
}
}
Then can be use like:
resolutionStrategy {
eachPlugin {
register("kotlinx-serialization", "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin")
}
}
gildor
12/13/2017, 5:33 AMlex
12/13/2017, 9:41 AMlex
12/13/2017, 9:42 AMOutdated Kotlin Runtime
Your version of Kotlin runtime in 'Gradle: org.jetbrains.kotlinkotlin stdlib1.1.61' library is 1.1.61-release-68 (1.1.61), while plugin version is 1.2.0-release-IJ2017.3-1.
Runtime library should be updated to avoid compatibility problems.
lex
12/13/2017, 9:45 AMplugins {
val kotlinVersion = "1.2.0"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
id("io.spring.dependency-management") version "1.0.3.RELEASE"
}
lex
12/13/2017, 9:45 AMdependencies {
compile(kotlin("stdlib"))
compile(kotlin("reflect"))
...
}
gildor
12/13/2017, 9:45 AMlex
12/13/2017, 9:46 AMlex
12/13/2017, 9:47 AMgildor
12/13/2017, 9:47 AMcompile(kotlin("stdlib", "1.2.0"))
gildor
12/13/2017, 9:47 AMlex
12/13/2017, 9:47 AMlex
12/13/2017, 9:47 AMlex
12/13/2017, 9:48 AMlex
12/13/2017, 10:13 AMcant be called in this context by implicit receiver
gildor
12/13/2017, 10:21 AMCzar
12/13/2017, 10:30 AMkotlin.version=1.2
in gradle properties.lex
12/13/2017, 10:33 AMCzar
12/13/2017, 10:33 AMCzar
12/13/2017, 10:38 AMlex
12/13/2017, 10:43 AMCzar
12/13/2017, 10:43 AMlex
12/13/2017, 10:44 AMCzar
12/13/2017, 10:47 AMjava
or java-library
plugin, replace implementation()
with compile()
lex
12/13/2017, 10:47 AMval kotlinVersion: String? by extra {
buildscript.configurations["classpath"]
.resolvedConfiguration.firstLevelModuleDependencies
// for gradle 4.4+ change "kotlin-gradle-plugin" to "org.jetbrains.kotlin.jvm.gradle.plugin"
.find { it.moduleName == "org.jetbrains.kotlin.jvm.gradle.plugin" }?.moduleVersion
}
extra["kotlin.version"] = kotlinVersion
dependencies {
compile(kotlin("stdlib-jdk8"))
compile(kotlin("reflect"))
...
}
gildor
12/13/2017, 10:51 AM