File tree Expand file tree Collapse file tree
main/kotlin/com/vanniktech/dependency/graph/generator
test/java/com/vanniktech/dependency/graph/generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtensi
44import guru.nidi.graphviz.attribute.Label
55import guru.nidi.graphviz.engine.Format
66import guru.nidi.graphviz.engine.Format.PNG
7+ import guru.nidi.graphviz.engine.Format.SVG
78import guru.nidi.graphviz.model.MutableNode
89import org.gradle.api.Project
910import org.gradle.api.artifacts.Configuration
@@ -45,7 +46,7 @@ open class DependencyGraphGeneratorExtension {
4546 /* * Return true when you want to include this project, false otherwise. */
4647 val includeProject : (Project ) -> Boolean = { true },
4748 /* * Return the output formats you'd like to be generated. */
48- val outputFormats : List <Format > = listOf(PNG )
49+ val outputFormats : List <Format > = listOf(PNG , SVG )
4950 ) {
5051 /* * Gradle task name that is associated with this generator. */
5152 val gradleTaskName = " generateDependencyGraph${name.capitalize()} "
Original file line number Diff line number Diff line change 11package com.vanniktech.dependency.graph.generator
22
33import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtension.Generator.Companion.ALL
4- import guru.nidi.graphviz.engine.Format.PNG
54import org.assertj.core.api.Java6Assertions.assertThat
65import org.junit.Test
76
@@ -10,8 +9,4 @@ class DependencyGraphGeneratorExtensionTest {
109 val defaults = DependencyGraphGeneratorExtension ()
1110 assertThat(defaults.generators).containsExactly(ALL )
1211 }
13-
14- @Test fun allDefaults () {
15- assertThat(ALL .outputFormats).containsExactly(PNG )
16- }
1712}
Original file line number Diff line number Diff line change @@ -82,8 +82,9 @@ class DependencyGraphGeneratorPluginTest {
8282 // No errors.
8383 assertThat(stdErrorWriter).hasToString(" " )
8484
85- // We don't want to assert the content of the image , just that it exists .
85+ // We don't want to assert the content of the images , just that they exist .
8686 assertThat(File (testProjectDir.root, " build/reports/dependency-graph/dependency-graph.png" )).exists()
87+ assertThat(File (testProjectDir.root, " build/reports/dependency-graph/dependency-graph.svg" )).exists()
8788
8889 assertThat(File (testProjectDir.root, " build/reports/dependency-graph/dependency-graph.dot" )).hasContent("""
8990 digraph "G" {
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package com.vanniktech.dependency.graph.generator
22
33import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtension.Generator
44import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtension.Generator.Companion.ALL
5+ import guru.nidi.graphviz.engine.Format.PNG
6+ import guru.nidi.graphviz.engine.Format.SVG
57import org.assertj.core.api.Java6Assertions.assertThat
68import org.junit.Test
79
@@ -22,4 +24,8 @@ class GeneratorTest {
2224 assertThat(ALL .outputFileNameDot).isEqualTo(" dependency-graph.dot" )
2325 assertThat(generatorFoo.outputFileNameDot).isEqualTo(" dependency-graph-foo-bar.dot" )
2426 }
27+
28+ @Test fun outputFormats () {
29+ assertThat(ALL .outputFormats).containsExactly(PNG , SVG )
30+ }
2531}
You can’t perform that action at this time.
0 commit comments