Skip to content

Instantly share code, notes, and snippets.

@BoxResin
BoxResin / settings.gradle.kts
Created February 6, 2020 03:54
Gradle 서브 모듈 자동 탐지하여 include 하는 스크립트
/** [name] 디렉터리 아래의 모듈을 모두 탐색하여 `AAA:BBB:CCC` 형식으로 반환한다. */
fun submodule(name: String): Array<String> {
// 모듈 디렉터리 탐색하기
val submoduleDirs: List<File> = fileTree(name)
.matching { include("**/*.gradle.kts") }
.map { gradleScript: File -> gradleScript.parentFile }
.distinct()
// gradle 프로젝트 이름 형식으로 고치기
return submoduleDirs