Last active
February 28, 2024 08:15
-
-
Save yunjaena/88a926535bfff91f0b03611dd87212e1 to your computer and use it in GitHub Desktop.
Gradle dependency graph generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
// ... | |
alias(libs.plugins.gradle.dependency.graph.generator) | |
alias(libs.plugins.idea.ext) | |
} | |
moduleGraphConfig { | |
readmePath.set("./README.md") | |
heading.set("### Dependency Diagram") | |
showFullPath.set(false) | |
orientation.set(Orientation.LEFT_TO_RIGHT) | |
linkText.set(LinkText.NONE) | |
theme.set(Theme.NEUTRAL) | |
} | |
fun Project.idea(block: IdeaModel.() -> Unit) = | |
(this as ExtensionAware).extensions.configure("idea", block) | |
fun IdeaProject.settings(block: ProjectSettings.() -> Unit) = | |
(this@settings as ExtensionAware).extensions.configure(block) | |
fun ProjectSettings.taskTriggers(block: TaskTriggersConfig.() -> Unit) = | |
(this@taskTriggers as ExtensionAware).extensions.configure("taskTriggers", block) | |
if (idea.project != null) { | |
val createModuleGraph by tasks.existing | |
idea { | |
project { | |
settings { | |
taskTriggers { | |
afterSync( | |
createModuleGraph | |
) | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[versions] | |
ideaExt = "1.1.7" | |
gradleDependencyGraphGenerator = "0.5.0" | |
[libraries] | |
[plugins] | |
idea-ext = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "ideaExt" } | |
gradle-dependency-graph-generator = { id = "dev.iurysouza.modulegraph", version.ref = "gradleDependencyGraphGenerator" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment