redmaster east
10/29/2024, 12:47 AMshippingJar), and then in my root build script creating configurations for each jar (they need to be in different places) by depending on them like so:
dependencies {
shippingIJ project(path: ':ij', configuration: 'shippingJar')
}
And then I use those in a shared copyspec:
def commonDist = project.copySpec {
if (configurations.shippingIJ.files.size() != 1) {
throw new GradleException("shippingIJ configuration must contain exactly one file")
}
from(configurations.shippingIJ) {
into ''
}
}redmaster east
10/29/2024, 12:49 AMVampire
10/29/2024, 1:23 AMshippingIJ is for resolving and declaration. 🙂
Regarding that size check, you can probably just do .files.singleFile or what it was called.
And besides that, 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. 🙂redmaster east
10/29/2024, 1:28 AMVampire
10/29/2024, 1:34 AMdeprecation or removalNot as far as I know. But anyone not using Kotlin DSL is just hurting themselves. 🙂
I see in the project board kotlin will become recommended for all projects.Afair very very big projects could maybe suffer some performance problems in some situations or something like that. While actually in some situations Kotlin DSL is also faster than Groovy DSL. I use it since years in small to mid projects without significant problems.
redmaster east
10/29/2024, 1:36 AMredmaster east
10/29/2024, 1:54 AMconfigurations.shippingIJ.singleFile breaks the automatic task dependency chain, using clean build with singleFile results in it not building the subproject, but when just using configurations.shippingIJ it will build the subproject automaticallyVampire
10/29/2024, 3:02 AMsingleFile you make it a File.
File does not have any dependency information.Vampire
10/29/2024, 3:03 AMfrom the configuration should stay, or you do some syntax trick like configurations.shippingIJ.tap { it.singleFile } or similarredmaster east
10/29/2024, 3:38 AM