Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import java.io.File
val dot = File(outputDirectory, generator.outputFileNameDot)
dot.writeText(graph.toString())

val graphviz = Graphviz.fromGraph(graph).run(generator.graphviz)
val graphviz = Graphviz.fromGraph(graph).withDefaultTotalMemory().run(generator.graphviz)

val renders = generator.outputFormats.map {
graphviz.render(it).toFile(File(outputDirectory, generator.outputFileName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import java.io.File
val dot = File(outputDirectory, projectGenerator.outputFileNameDot)
dot.writeText(graph.toString())

val graphviz = Graphviz.fromGraph(graph).run(projectGenerator.graphviz)
val graphviz = Graphviz.fromGraph(graph).withDefaultTotalMemory().run(projectGenerator.graphviz)

val renders = projectGenerator.outputFormats.map {
graphviz.render(it).toFile(File(outputDirectory, projectGenerator.outputFileName))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.vanniktech.dependency.graph.generator

import com.vanniktech.dependency.graph.generator.ProjectTarget.MULTIPLATFORM
import guru.nidi.graphviz.engine.Graphviz
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ProjectDependency
import kotlin.math.pow

internal fun String.nonEmptyPrepend(prepend: String) =
if (isNotEmpty()) prepend + this else this
Expand Down Expand Up @@ -34,3 +36,5 @@ internal fun Project.target(): ProjectTarget {
}

internal fun Configuration.isImplementation() = name.lowercase().endsWith("implementation")

internal fun Graphviz.withDefaultTotalMemory() = totalMemory(2.0.pow(30).toInt())