diff --git a/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTask.kt b/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTask.kt index af24690..47b132c 100644 --- a/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTask.kt +++ b/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTask.kt @@ -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)) diff --git a/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectDependencyGraphGeneratorTask.kt b/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectDependencyGraphGeneratorTask.kt index 461f061..4d2c308 100644 --- a/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectDependencyGraphGeneratorTask.kt +++ b/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectDependencyGraphGeneratorTask.kt @@ -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)) diff --git a/src/main/kotlin/com/vanniktech/dependency/graph/generator/extensions.kt b/src/main/kotlin/com/vanniktech/dependency/graph/generator/extensions.kt index 4bc9437..5480e39 100644 --- a/src/main/kotlin/com/vanniktech/dependency/graph/generator/extensions.kt +++ b/src/main/kotlin/com/vanniktech/dependency/graph/generator/extensions.kt @@ -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 @@ -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())