I’m currently running into the following issue: R...
# gradle
t
I’m currently running into the following issue: Right before the issue came up for the first time, i added new Aspects to my
buildSrc/src/main/kotlin/example.kotlin-convention.gradle.kts
Copy code
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm")
    id("example.java-conventions")
}

dependencies {
    testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}

tasks.withType<KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs = listOf("-Xjsr305=strict")
        jvmTarget = "1.8"
    }
}
Unfortunately with
Aspects
one isn’t allowed to define the version in the
plugins
block, so I had to add the version to the
buildSrc/build.gradle.kts
Copy code
dependencies {
    ...
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")
    ...
}
The stacktrace:
v
I'm not exactly following what you mean by
Aspects
But it is correct, that you cannot use use a version in
plugins
blocks of pre-compiled script plugins, but that you add those plugins to the class path in the build script. Can you maybe provide an MCVE that shows what you are struggling with?
t
In some parts of the gradle documentation
pre-compiled scripts
are referenced as
aspects
. (Example: https://docs.gradle.org/current/samples/sample_jvm_multi_project_with_code_coverage.html)
Gonna create a MCVE, should be ready in about 5min
https://github.com/Lacritz/gradle-pre-compiled-script-kotlin There we go - unfortunately - as usual, the prod. code just doesn’t work while the MCVE isn’t much a MCVE since it works just fine.
v
I would not agree they call it
aspects
, they at most call them "aspects". If you write
aspect
or
Aspect
I assume you are talking about some code construct or similar that I'm not familiar with. They just use "aspect" as descriptive term imho, but they still call it pre-compiled script plugin or convention plugin. 🙂
Well, if the MCVE works unlike the production code, it is no MCVE, it misses the
V
part. 🙂 Try to make it an MCVE and you maybe already have your answer. 🙂
t
Well. Wasn’t able to reproduce it at all, but was able to fix it. Reason was a miss-match between the installed kotlin version and the version being used by Gradle. Gradle was using 1.4.x and the while having a dependency declared on 1.3.x. Upgrading the local kotlin version as well as setting the kotlin dependency to 1.4.x worked just fine
👌 1