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")) {
h2("QA Reports")
p(){
junitURL = nightly+"test/result-"+module
stats = "";
try {
junitURL.toURL().eachLine {
localReport = new File("reports/result-"+module + ".txt")
if (localReport.exists()) {
// use local
localReport.eachLine {
if (it =~ ~/Tests\srun/) {
stats = it
}
}
a(href:junitURL,"JUnit")
span(": " + stats)
} catch (FileNotFoundException exc) {
} catch (SocketException exc) {}
span("JUnit: " + stats)
} else {
// use remote
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(){
a(href:nightly+"javadoc/$module/", "DocCheck Results")
}
p(){
span("PDM: ")
a(href:nightly+"pmd-unused/"+module+".html", "unused")
a(href:nightly+"pmd-migrating/"+module+".html", "migration")
a(href:nightly+"pmd/"+module+".html", "all")
localReport = new File("reports/pmd/"+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/"+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")
p(){
Expand Down

0 comments on commit 35550bd

Please sign in to comment.