Skip to content

Instantly share code, notes, and snippets.

@bitkill
Created March 18, 2025 12:27
Show Gist options
  • Save bitkill/ee86d06eda03de532fe0f917553e3405 to your computer and use it in GitHub Desktop.
Save bitkill/ee86d06eda03de532fe0f917553e3405 to your computer and use it in GitHub Desktop.
[gradle convention include] #gradle
// Instead of "include ':module'", search for all gradle files in sub-folders
dependencyResolutionManagement {
repositories {
mavenCentral()
}
rootDir.parentFile.listFiles()?.findAll {
new File(it, "settings.gradle").exists()
}?.each {
includeBuild it.path
}
}
rootDir.listFiles()?.findAll {
new File(it, "build.gradle").exists()
}?.each {
include it.name
}
// Instead of "include ':module'", search for all gradle files in sub-folders
dependencyResolutionManagement {
repositories.mavenCentral()
rootDir.parentFile.listFiles()?.filter {
File(it, "settings.gradle.kts").exists()
}?.forEach {
includeBuild(it.path)
}
}
rootDir.listFiles()?.filter {
File(it, "build.gradle.kts").exists()
}?.forEach {
include(it.name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment