Humphrey
03/22/2023, 4:07 PMid("jacoco")
in the plugins section of build.gradle I would like to use alias(libs.plugins.jacoco)
ephemient
03/22/2023, 4:12 PMephemient
03/22/2023, 4:14 PMid("foo")
is actually id("org.gradle.foo")
when dealing with built-in pluginsCLOVIS
03/22/2023, 4:17 PMunspecified
Humphrey
03/22/2023, 4:18 PMunspecified
as well.Humphrey
03/22/2023, 4:21 PMorg.gradle.api.GradleException: Error resolving plugin [id: 'org.gradle.jacoco', version: 'unspecified']
CLOVIS
03/22/2023, 4:22 PMplugins
block. However, it's mandatory to always specify a version in the version catalog, even if it's a built-in plugin. unspecified
works for convention plugins, I don't know if it works for built-in pluginsHumphrey
03/22/2023, 4:23 PMjacoco = { id = "org.gradle.jacoco", version = "unspecified"}
Humphrey
03/22/2023, 4:24 PMephemient
03/22/2023, 4:25 PMplugins {
jacoco
}
just works in the Kotlin DSLHumphrey
03/22/2023, 4:26 PMCLOVIS
03/22/2023, 4:27 PMephemient
03/22/2023, 4:28 PMplugins {
`kotlin-dsl`
}
(you could write ``jacoco`` too but there's no need to)Humphrey
03/22/2023, 4:31 PM[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinVersion" }
and then just
plugins {
`kotlin`
}
like this or whithout the backticks?
Instead of
plugins {
alias(libs.plugins.kotlin)
}
ephemient
03/22/2023, 4:32 PMephemient
03/22/2023, 4:32 PMkotlin-dsl
and embedded-kotlin
built-in, but those are different than org.jetbrains.kotlin.*
Humphrey
03/22/2023, 4:34 PMephemient
03/22/2023, 4:34 PMHumphrey
03/22/2023, 4:35 PMephemient
03/22/2023, 4:35 PMjava-library
Humphrey
03/22/2023, 4:36 PMVampire
03/22/2023, 5:00 PMunspecified
is an actual version.
If you have to use unspecified
for your convention plugins @CLOVIS, then just because that is the version you configured in the build for those convention plugins.
In this case "configured" by not configuring explicitly, but keeping the default value which is "unspecified" but otherwise not a magic string, but a version like any other. đŸ˜‰CLOVIS
03/22/2023, 5:00 PMVampire
03/22/2023, 5:04 PMVampire
03/22/2023, 5:05 PMbuildSrc
.
Because things from included builds usually take precedence over declared versions, so you could also use _
as version or any other String you like.CLOVIS
03/22/2023, 5:05 PM1.0
and it doesn't work. Only unspecified
is accepted.Vampire
03/22/2023, 5:14 PM