Skip to content

Commit

Permalink
Use local PMD and JUnit reports if available
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Dec 28, 2009
1 parent fcdad41 commit 35550bd
Showing 1 changed file with 50 additions and 11 deletions.
61 changes: 50 additions & 11 deletions createModulePages.groovy
Expand Up @@ -53,28 +53,67 @@ files.each { file ->
if (!module.contains("test")) { if (!module.contains("test")) {
h2("QA Reports") h2("QA Reports")
p(){ p(){
junitURL = nightly+"test/result-"+module localReport = new File("reports/result-"+module + ".txt")
stats = ""; if (localReport.exists()) {
try { // use local
junitURL.toURL().eachLine { localReport.eachLine {
if (it =~ ~/Tests\srun/) { if (it =~ ~/Tests\srun/) {
stats = it stats = it
} }
} }
a(href:junitURL,"JUnit") span("JUnit: " + stats)
span(": " + stats) } else {
} catch (FileNotFoundException exc) { // use remote
} catch (SocketException exc) {} junitURL = nightly+"test/result-"+module
stats = "";
try {
junitURL.toURL().eachLine {
if (it =~ ~/Tests\srun/) {
stats = it
}
}
a(href:junitURL,"JUnit")
span(": " + stats)
} catch (FileNotFoundException exc) {
} catch (SocketException exc) {}
}
} }
} }
p(){ p(){
a(href:nightly+"javadoc/$module/", "DocCheck Results") a(href:nightly+"javadoc/$module/", "DocCheck Results")
} }
p(){ p(){
span("PDM: ") span("PDM: ")
a(href:nightly+"pmd-unused/"+module+".html", "unused") localReport = new File("reports/pmd/"+module + ".xml")
a(href:nightly+"pmd-migrating/"+module+".html", "migration") if (localReport.exists()) {
a(href:nightly+"pmd/"+module+".html", "all") def pmd = null
try {
pmd = new XmlParser().parseText(localReport.text)
span("Violations=" + pmd.file.violation.size())
} catch (Exception exception) {}
} else {
a(href:nightly+"pmd/"+module+".html", "all")
}
localReport = new File("reports/pmd-unused/"+module + ".xml")
if (localReport.exists()) {
def pmd = null
try {
pmd = new XmlParser().parseText(localReport.text)
span("Violations=" + pmd.file.violation.size())
} catch (Exception exception) {}
} else {
a(href:nightly+"pmd-unused/"+module+".html", "unused")
}
localReport = new File("reports/pmd-migrating/"+module + ".xml")
if (localReport.exists()) {
def pmd = null
try {
pmd = new XmlParser().parseText(localReport.text)
span("Violations=" + pmd.file.violation.size())
} catch (Exception exception) {}
} else {
a(href:nightly+"pmd-migrating/"+module+".html", "migration")
}
} }
h2("Depends") h2("Depends")
p(){ p(){
Expand Down

0 comments on commit 35550bd

Please sign in to comment.