I have 2 questions: 1. Does anyone know how to use...
# gradle
s
I have 2 questions: 1. Does anyone know how to use the C plugin from Kotlin Script Gradle? The key extension namespace for it is
model
, but that doesn’t seem to exist in the kotlin world. 2. if I run
./gradlew :project:tasks
I get a list of tasks for that project. I can do something like this in gradle 6.9:
Copy code
def copyDylib = tasks.register('copyDylib', Copy) {
    dependsOn "assembleDependentsMyJniLibrarySharedLibrary"

    from(file("$buildDir/libs/myjnilibrary/shared/"))
    into(file("$resourcesPath"))
}
But after upgrading to Gradle 7.x, it can no longer find the task
assembleDependentsMyJniLibrarySharedLibrary
even though I can call it and it clearly exists. I’ve also tried
afterEvaluate
with the same result.
v
You should not use these model based plugins at all. They are a relic of a failed experiment. You should not use it for need things and immigrate old things to the new replacement plugins.
Also the Kotlin DSL primer clearly states at https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:limitations:
The Kotlin DSL will not support the model {} block, which is part of the discontinued Gradle Software Model.
s
You should not use these model based plugins at all. They are a relic of a failed experiment. You should not use it for need things and immigrate old things to the new replacement plugins.
What model based plugins? I just followed the jni instructions on jetbrains website. Is there something better than the
c
plugin?
v
Those instructions are obviously outdated if they recommend these legacy discontinued plugins.
It also links to the replacement plugins