Skip to content

Commit

Permalink
Generate PNG image into build/reports/dependency-graph directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech committed Mar 21, 2018
1 parent 5a85b9f commit 0276a5a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ open class DependencyGraphGeneratorExtension {
private val outputFileName = "dependency-graph${name.toHyphenCase().nonEmptyPrepend("-")}"
internal val outputFileNameDot = "$outputFileName.dot"

/** Output file name of the genreated png which is stored on module level. */
/** Output file name of the generated png which is stored under build/reports/dependency-graph/ */
val outputFileNamePng = "$outputFileName.png"

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ open class DependencyGraphGeneratorPlugin : Plugin<Project> {
task.description = "Generates a dependency graph${it.name.nonEmptyPrepend(" for ")}"
task.inputFile = project.buildFile
task.outputFileDot = File(project.buildDir, "reports/dependency-graph/${it.outputFileNameDot}")
task.outputFileImage = File(project.projectDir, it.outputFileNamePng)
task.outputFileImage = File(project.buildDir, "reports/dependency-graph/${it.outputFileNamePng}")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DependencyGraphGeneratorPluginTest {
assertThat(task.description).isEqualTo("Generates a dependency graph")
assertThat(task.inputFile).hasToString(singleProject.buildFile.toString())
assertThat(task.outputFileDot).hasToString(File(singleProject.buildDir, "reports/dependency-graph/dependency-graph.dot").toString())
assertThat(task.outputFileImage).hasToString(File(singleProject.projectDir, "dependency-graph.png").toString())
assertThat(task.outputFileImage).hasToString(File(singleProject.buildDir, "reports/dependency-graph/dependency-graph.png").toString())
}

@Test fun integrationTestGradle46() {
Expand Down Expand Up @@ -89,7 +89,7 @@ class DependencyGraphGeneratorPluginTest {
assertThat(stdErrorWriter).hasToString("")

// We don't want to assert the content of the image, just that it exists.
assertThat(File(testProjectDir.root, "dependency-graph.png")).exists()
assertThat(File(testProjectDir.root, "build/reports/dependency-graph/dependency-graph.png")).exists()

assertThat(File(testProjectDir.root, "build/reports/dependency-graph/dependency-graph.dot")).hasContent("""
|digraph G {
Expand Down Expand Up @@ -180,7 +180,7 @@ class DependencyGraphGeneratorPluginTest {
assertThat(stdErrorWriter).hasToString("")

// We don't want to assert the content of the image, just that it exists.
assertThat(File(testProjectDir.root, "dependency-graph.png")).exists()
assertThat(File(testProjectDir.root, "build/reports/dependency-graph/dependency-graph.png")).exists()

assertThat(File(testProjectDir.root, "build/reports/dependency-graph/dependency-graph.dot")).hasContent("""
|digraph G {
Expand Down

0 comments on commit 0276a5a

Please sign in to comment.