Skip to content

Commit 2969f9d

Browse files
Check license report file presence before reading
As we've applied the workaround from jk1/Gradle-License-Report#337, nested parent projects may not have report files.
1 parent a1037ee commit 2969f9d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ object LicenseReporter {
156156
"$buildDir/${Paths.relativePath}/${Paths.outputFilename}"
157157
}
158158
println("Merging the license reports from the all projects.")
159-
val mergedContent = paths.joinToString("\n\n\n") { (File(it)).readText() }
159+
val mergedContent = paths.joinToString("\n\n\n") {
160+
val file = File(it)
161+
if (file.exists()) file.readText() else ""
162+
}
160163
val output = File("${rootProject.rootDir}/${Paths.outputFilename}")
161164
output.writeText(mergedContent)
162165
}

0 commit comments

Comments
 (0)