fixed bug with outputFile property handling
This commit is contained in:
@@ -156,16 +156,19 @@ class JPMSCheckPlugin implements Plugin<Project> {
|
|||||||
boolean recursive = project.properties["jpms-check.recursive"]?.with(Boolean.&parseBoolean) ?: false
|
boolean recursive = project.properties["jpms-check.recursive"]?.with(Boolean.&parseBoolean) ?: false
|
||||||
String cfgName = project.properties["jpms-check.configurationName"] ?: "default"
|
String cfgName = project.properties["jpms-check.configurationName"] ?: "default"
|
||||||
String outputFormat = project.properties["jpms-check.outputFormat"] ?: "html"
|
String outputFormat = project.properties["jpms-check.outputFormat"] ?: "html"
|
||||||
Path outputFile
|
Path outputFile = project.properties["jpms-check.outputFile"]?.with {
|
||||||
switch(outputFormat) {
|
Paths.get(it as String)
|
||||||
case "html":
|
} ?: with {
|
||||||
outputFile = Paths.get(project.properties["jpms-check.outputFile"]) ?: Paths.get(project.buildDir.path, "jpms-report.html")
|
switch(outputFormat) {
|
||||||
break
|
case "html":
|
||||||
case "json":
|
Paths.get(project.buildDir.path, "jpms-report.html")
|
||||||
outputFile = Paths.get(project.properties["jpms-check.outputFile"]) ?: Paths.get(project.buildDir.path, "jpms-report.json")
|
break
|
||||||
break
|
case "json":
|
||||||
default:
|
Paths.get(project.buildDir.path, "jpms-report.json")
|
||||||
throw new IllegalArgumentException("Unsupported output format: $outputFormat")
|
break
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unsupported output format: $outputFormat")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
doLast {
|
doLast {
|
||||||
Set<CheckResult> results = (recursive ? project.subprojects.stream() : Stream.of(project)).flatMap {
|
Set<CheckResult> results = (recursive ? project.subprojects.stream() : Stream.of(project)).flatMap {
|
||||||
|
Reference in New Issue
Block a user