In the project we moved from `buildSrc` towards `i...
# community-support
s
In the project we moved from
buildSrc
towards
includeBuild("build-logic")
, but there are few leftovers. In
build.gradle
scripts we have
import
statements like
Copy code
import com.acme.gradle.transform.UnzipTransform

dependencies.registerTransform(UnzipTransform) {
    from.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, "jar")
    to.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, "unzipped")
}
or
Copy code
import com.acme.gradle.sql.ImportSqlDump
...
tasks.register('importInterchangeDump', ImportSqlDump) {
    database = "acquiring"
    username = "${db.adminUser}"
    password = "${db.adminPassword}"
    importFiles = [project.projectDir.toPath().resolve("db/dump/interchange.sql.gz").toFile()]
}
For this reason we cannot drop the
buildSrc
directory, which now only has
build.gradle
with several declared dependencies for scripts. More or less I understand we should move towards a mix of plugins imported by their id + extensions declaring parameters. Any other guidelines advised there?
1
v
"cannot" is not correct. :-) You could e.g. have those dependencies in the
buildscript
block of the respective build script. Or you could e.g. have the dependencies in the build of any project in
build-logic
and then apply a plugin from that project that does nothing in
apply
. Or you could e.g. have the dependencies in the build of any project in
build-logic
and then "apply" any plugin from that project with "`apply false`".
Btw. I strongly recommend switching to Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.
s
thank you!
👌 1