Travis Reitter
01/18/2022, 6:55 PMcreate()
function here from a Groovy gradle file. I've tried calling this way:
cklib {
create("sqlighter") {
language "co.touchlab.cklib.gradle.CompileToBitcode.Language.OBJC"
}
}
but I'm getting:
org.gradle.api.GradleScriptException: A problem occurred evaluating project ':SharedCode'.
...
Caused by: groovy.lang.MissingMethodException: No signature of method: build_89t0gtdiazmlot5b0npjl25b8.cklib() is applicable for argument types: (build_89t0gtdiazmlot5b0npjl25b8$_run_closure3) values: [build_89t0gtdiazmlot5b0npjl25b8$_run_closure3@7e7932ea]
Possible solutions: mkdir(java.lang.Object), split(groovy.lang.Closure), wait(), file(java.lang.Object), wait(long), copy(groovy.lang.Closure)
Here's a working example of it being called from Kotlin DSL.
What simple syntax error am I making? ๐hfhbd
01/18/2022, 6:59 PMcreate
but cklib
. How do you apply the plugin?Travis Reitter
01/18/2022, 7:00 PMapply plugin: 'co.touchlab.cklib'
hfhbd
01/18/2022, 7:01 PMplugins
block? If you apply the plugin dynamically at runtime, the Kotlin compiler does not find the cklib
extension at compile time.Travis Reitter
01/18/2022, 7:01 PMplugins {
id 'co.touchlab.cklib'
}
Travis Reitter
01/18/2022, 7:02 PMplugins
block before this)hfhbd
01/18/2022, 7:02 PMapply(plugin = "org.jetbrains.kotlin.jvm")
extensions.configure<org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension>("kotlin") {
explicitApi()
sourceSets.all {
languageSettings {
progressiveMode = true
optIn("kotlin.RequiresOptIn")
}
}
target.compilations.all {
kotlinOptions.allWarningsAsErrors = true
}
}
Travis Reitter
01/18/2022, 7:03 PMkotlin
block. Is it possible to work it into there or is that unrelated?hfhbd
01/18/2022, 7:03 PMplugins {
kotlin("multiplatform")
id("co.touchlab.cklib")
}
Travis Reitter
01/18/2022, 7:03 PMhfhbd
01/18/2022, 7:04 PMhfhbd
01/18/2022, 7:04 PMTravis Reitter
01/18/2022, 7:04 PMTravis Reitter
01/18/2022, 7:05 PMplugins {
kotlin("multiplatform")
id("co.touchlab.cklib")
}
but hit
build file '.../SharedCode/build.gradle': 2: only id(String) method calls allowed in plugins {} script block
hfhbd
01/18/2022, 7:06 PMkotlin()
is a Kotlin DSL only function. In Groovy, you have to use id("org.jetbrains.kotlin.jvm")
I thinkTravis Reitter
01/18/2022, 7:09 PMapply plugin: 'org.jetbrains.kotlin.multiplatform'
because kotlin
gets redefinedTravis Reitter
01/18/2022, 7:10 PMplugins {
id("org.jetbrains.kotlin.multiplatform")
id("co.touchlab.cklib")
}
// FIXME: cut?
//apply plugin: 'org.jetbrains.kotlin.multiplatform'
apply plugin: 'com.android.library'
apply plugin: 'com.squareup.sqldelight'
apply plugin: 'kotlinx-serialization'
I end up with the original build failure:
No signature of method: build_89t0gtdiazmlot5b0npjl25b8.cklib() is applicable for argument types [...]
hfhbd
01/18/2022, 7:18 PMTravis Reitter
01/18/2022, 7:20 PMTravis Reitter
01/18/2022, 7:21 PMj2objc
to KMM, I've already done a bunch of smaller migrations in the middle and it's really stretched this process out a lot more than I'd hoped. I almost always prefer to do one thing at a time to keep my sanity ๐Travis Reitter
01/18/2022, 7:22 PMcklib
pluginVampire
01/18/2022, 8:50 PMTravis Reitter
01/18/2022, 10:35 PM