Arjan van Wieringen
05/12/2023, 4:47 PMsubprojects {
val subGroup = path.replace(':', '.').replace('-', '_')
group = "${rootProject.group}$subGroup"
}
But of course, if I would have read a little further I would have read that this causes issues with the distribution
plugin, because you get conflicting JAR names in the lib directory. But I see no solution there. Does anyone know of a way on how to solve this? I can not find out how to change the jar name in 'bulk'.
Otherwise I think I just have to revert to having them named: library-ui-compose, and feature-foo-compose and deal with the awkward UI experience in IntelliJ. I really like having deep folder structures., but alas.ephemient
05/12/2023, 4:54 PM// settings.gradle.kts
include(":library-ui-compose", ":feature-foo-compose")
project(":library-ui-compose").projectDir = file("library/ui/compose")
project(":feature-foo-compose").projectDir = file("feature/foo/compose")
you could even automate it by iterating over rootProject.children
Arjan van Wieringen
05/12/2023, 4:59 PMChris Lee
05/12/2023, 5:32 PMgroup
) to have distinct JAR names:
tasks.withType<Jar>().configureEach {
val newName = project.path.replace(":", "-").drop(1)
archiveBaseName.set("app-$newName")
}
ephemient
05/12/2023, 5:39 PMChris Lee
05/12/2023, 5:40 PMdistribution
but doesn’t solve beyond that.Arjan van Wieringen
05/12/2023, 6:35 PMVampire
05/12/2023, 6:43 PM// settings.gradle.kts
include(":libraries:ui:library-ui-compose", ":features:foo:feature-foo-compose")
project(":libraries:ui:library-ui-compose").projectDir = file("library/ui/compose")
project(":features:foo:feature-foo-compose").projectDir = file("feature/foo/compose")
?Arjan van Wieringen
05/12/2023, 7:06 PMephemient
05/12/2023, 7:22 PMval projectDirs = setOf(
"library/ui/compose",
"feature/foo/compose",
)
for (dir in dirs) {
val path = dir.substringBeforeLast('/', "").replace('/', ':') + ':' + dir.replace('/', '-:)
include(path)
project(path).projectDir = file(dir)
}
Arjan van Wieringen
05/13/2023, 5:39 AM