Created
March 18, 2025 12:27
-
-
Save bitkill/ee86d06eda03de532fe0f917553e3405 to your computer and use it in GitHub Desktop.
[gradle convention include] #gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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