vanniktech / gradle-dependency-graph-generator-plugin

Gradle plugin that generates dependency graphs from your project.
http://vanniktech.com
Apache License 2.0
1.55k stars 97 forks source link

Change directory output #231

Open dmondon-accor opened 1 year ago

dmondon-accor commented 1 year ago

Hi! Is it possible to change the directory output to save in another directory than /build? Thanks

vanniktech commented 1 year ago

Nope it isn't. Why would you want to change it? It's quite common to place reports there.

jonapoul commented 10 months ago

For what it's worth, I was looking to do the same thing. Reason being that I want to be able to check the dotfile and PNG into git and easily reference in readmes, etc. I know I can use gitignore for that, but it's a bit ugly.

I managed to get it working by registering my own instance of ProjectDependencyGraphGeneratorTask without using the plugin's extension, like:

val generator = DependencyGraphGeneratorExtension.ProjectGenerator(
  // your config here
)

project.tasks.register("generateReadmeDiagram", ProjectDependencyGraphGeneratorTask::class.java) {
  projectGenerator = generator
  outputDirectory = File(project.projectDir, "docs") // change this!
}

then running gradle generateReadmeDiagram.