This message was deleted.
# community-support
s
This message was deleted.
d
Gradle handles 400+ subprojects, my last job had one project with about 400 of them combined with a silly mess of internal dependencies
☝️ 1
m
Can I somehow programatically add sub-projects to a Gradle project? Or does each sub-project need to have
gradle.build
file?
d
Sure, the settings is pretty flexible, you could iterate over the projects and include them, see https://docs.gradle.org/current/javadoc/org/gradle/api/initialization/Settings.html for more of what you can do. And while you don't need a
build.gradle
file, why not put the build logic into a convention plugin and then script the initial setup? Each
build.gradle
would then only apply the convention plugin
a
Maybe you could start just by splitting packages in smaller number of projects, e.g. in 10 projects (so it’s not 1:1), since there is also some cost of setting up a compiler. So if you have a lot of packages with small number of classes it could be faster if they are compiled at once. Also maybe check how to increase memory of a Kotlin daemon: https://kotlinlang.org/docs/gradle.html#setting-kotlin-daemon-s-jvm-arguments. Additionally to that Kotlin also has an incremental compilation that might help you, when doing small changes (it’s not yet stable though): https://kotlinlang.org/docs/gradle.html#a-new-approach-to-incremental-compilation.
e