dave08
11/09/2023, 11:40 AMVampire
11/09/2023, 11:45 AMplugins { ... }
block is special.
It is extracted from the build script and applied to a dummy project to find out which type-safe accessors need to be generated for the set of applied plugins.
You could maybe try to use the fully-qualified form instead of an import, but I highly doubt it will work.dave08
11/09/2023, 11:49 AMVampire
11/09/2023, 11:51 AMdave08
11/09/2023, 11:51 AMVampire
11/09/2023, 11:52 AMdave08
11/09/2023, 11:52 AMplugins {
id("com.google.dagger.hilt.android") version "2.46.1" apply false
}
Vampire
11/09/2023, 11:52 AM--scan
if you candave08
11/09/2023, 11:54 AMVampire
11/09/2023, 12:11 PMdave08
11/09/2023, 12:14 PMVampire
11/09/2023, 1:09 PMversionCatalogs {
create("libs") {
from(files("../libs.versions.toml"))
}
}
or similar always worked fine for me actuallygradle.rootProject {
tasks.configureEach {
if (name == "refreshVersions") {
doFirst {
copy {
from(gradle.parent!!.rootProject.file("gradle/libs.versions.toml"))
into("gradle")
}
}
doLast {
// work-around for <https://github.com/jmfayard/refreshVersions/issues/661>
// and <https://github.com/jmfayard/refreshVersions/issues/663>
file("gradle/libs.versions.toml").apply {
readText()
.replace("⬆ =", " ⬆ =")
.replace("]\n\n", "]\n")
.replace("""(?s)^(.*)(\n\Q[plugins]\E[^\[]*)(\n.*)$""".toRegex(), "$1$3$2")
.also { writeText(it) }
}
copy {
from("gradle/libs.versions.toml")
into(gradle.parent!!.rootProject.file("gradle"))
}
delete("gradle")
}
}
}
}
dave08
11/09/2023, 1:17 PMVampire
11/09/2023, 1:18 PM