Created
February 10, 2023 13:16
-
-
Save mediavrog/1b8aa51b8e273405cc0d1276bd92d5d7 to your computer and use it in GitHub Desktop.
Include gradle modules from a directory automatically
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
/** | |
* Include all modules in a directory at once. | |
*/ | |
def includeAllModules(def modulesDirName, def modulePrefix = '') { | |
file("$rootDir/$modulesDirName").eachDir { dir -> | |
if (file("$dir/build.gradle").exists() || file("$dir/build.gradle.kts").exists()) { | |
include "${modulePrefix}:${dir.name}" | |
project("${modulePrefix}:${dir.name}").projectDir = dir | |
} | |
} | |
} | |
include(":app") | |
includeAllModules("feature-modules") | |
includeAllModules("sdk/ads', ":ads") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment