I am transitioning my code to Kotlin DSL and as i have multimodule app i have some hack to transition gralde tasks like clean, build etc to other modules. So i have following method in gradle:
private static def getSubProjectTasks(subprojects, taskName) {
def tasks = []
subprojects.each { Project project ->
if (project.subprojects.size() == 0) {
def relativeModulePath = project.path.replace(":feature:", "")
tasks.add("$relativeModulePath:$taskName")
}
}
return tasks
}
Now trying to transition into kotlin dsl i started with this way
fun getSubProjectTasks(subproject: Unit, taskName: String) {
for(project in subproject) {
if(project.subprojects.size() == 0) {
}
}
}
I am not really sure in Kotlin DSL what type subproject is? Is this just a collection or Unit or how to transition this method.