Skip to content

Instantly share code, notes, and snippets.

@47star
Created April 11, 2023 04:51
Show Gist options
  • Save 47star/e4c94c8a0da72bf165c4ff065e393334 to your computer and use it in GitHub Desktop.
Save 47star/e4c94c8a0da72bf165c4ff065e393334 to your computer and use it in GitHub Desktop.
Snippet for Gradle submodule definition in Kotlin DSL
class GradleSubmodule(
private val name: String,
private vararg val children: GradleSubmodule,
) {
operator fun unaryPlus() = load("")
private fun load(parent: String) {
include("$parent:$name")
for (child in children) {
child.load("$parent:$name")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment