Skip to content

Instantly share code, notes, and snippets.

@arunkumar9t2
Created August 10, 2020 04:26
Show Gist options
  • Save arunkumar9t2/e54813d300384b4bb0d6da48e188cef1 to your computer and use it in GitHub Desktop.
Save arunkumar9t2/e54813d300384b4bb0d6da48e188cef1 to your computer and use it in GitHub Desktop.
Prints all classes in an android/kotlin/java project.
tasks.register("collectClasses") {
subprojects {
dependsOn tasks.withType(JavaCompile)
dependsOn tasks.withType(KotlinJvmCompile)
}
doLast {
subprojects {
(tasks.withType(JavaCompile) + tasks.withType(KotlinJvmCompile)).forEach { compile ->
compile.destinationDirectory
.getAsFileTree()
?.matching { include("**/*.class") }
?.files
?.forEach {
println(it)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment