Hey! A newbie question. I'm trying to share build ...
# gradle
p
Hey! A newbie question. I'm trying to share build logic between modules. Since my logic is simple, I decided to go with "imperative" approach. I added following script:
buildSrc/kover.gradle.kts
. But it seems like my plugin is not recognized:
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.jetbrains.kotlinx.kover'] was not found in any of the following sources:
Copy code
// kover.gradle.kts
plugins {
    id("org.jetbrains.kotlinx.kover")
}
koverMerged {
    enable()
}

// build.gradle.kts
plugins {
    `kotlin-dsl`
}
repositories {
    mavenCentral()
    gradlePluginPortal()
}
m
Looks like you need to specify the version?
p
if I specify version, gradle says:
Plugin requests from precompiled scripts must not include a version number.
m
How do you include your
kover.gradle.kts
?
apply()
?
p
I didn't come to that part yet ­čÖé
I'm just trying to implement it in buildSrc, without using it for now
m
p
hm, I've put it to
src/main/java
let me try
m
Then if you follow that section, it says you must declare the
kover
plugin as
implementation
in
buildSrc/build.gradle.kts
p
um, I'm still "scratching my head". I've changed
buildSrc/build.gradle.kts
to:
Copy code
plugins {
    `kotlin-dsl`
}

repositories {
    mavenCentral()
    gradlePluginPortal()
}

dependencies {
    implementation("org.jetbrains.kotlinx.kover:0.6.1")
}
But now I'm getting:
Execution failed for task 'buildSrcgenerateExternalPluginSpecBuilders'.
> Could not resolve all files for configuration 'buildSrccompileClasspath'.
> Could not find org.jetbrains.kotlinx.kover0.6.1.
Required by:
project :buildSrc
mavenCentral()
is a correct repo for kover, I double checked
a
org.jetbrains.kotlinx.kover
is a plugin ID, but not a maven artifact coordinates declaration. The coordinates are
org.jetbrains.kotlinx:kover-gradle-plugin
p
ok, Bob's my uncle now. Thanks guys!