This open-source Gradle plugin aims to help developers investigate the HMPP structure of Kotlin Multiplatform (KMP) source sets with ease. By graphically visualizing the relationships between source sets and clearly indicating their hierarchy, the plugin simplifies understanding and maintaining complex KMP projects.
- Graphical visualization of dependencies between source sets
- Seamless Integration with Gradle builds
- Full compatibility with any KMP project
- Various output formats (SVG, PNG, JSON, DOT etc)
To use KMP-hierarchy plugin, include the following in your build.gradle(.kts) file:
plugins {
id("io.github.terrakok.kmp-hierarchy").version("1.1")
}
After successful installation, the plugin will be ready to use.
./gradlew :printHierarchy
Example of SVG output for compose-multiplatform/components/resources/library module:
plugins {
id("org.jetbrains.kotlin.multiplatform").version("1.9.23")
id("io.github.terrakok.kmp-hierarchy").version("1.1")
}
kotlin {
//...
printHierarchy {
//Sets the formats to be used for generating output files.
formats(Format.SVG)
//Boolean variable indicating whether to include test hierarchy in the generated output.
withTestHierarchy = false
//The output directory where the generated files will be saved.
outputDir.set(layout.buildDirectory.dir("kmp-hierarchy"))
}
}