Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[f6595d]: supernightly.groovy Maximize Restore History

Download this file

supernightly.groovy    99 lines (95 with data), 3.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* Copyright (C) 2009 Egon Willighagen <egonw@users.sf.net>
*
* LGPL 2.1
*/
import groovy.xml.MarkupBuilder;
def nodes = new XmlParser().parseText(new File("nodes.xml").text)
def writer = new StringWriter()
def xml = new MarkupBuilder(writer)
xml.html(xmlns: "http://www.w3.org/1999/xhtml") {
head() {
title('SuperNightly')
}
body() {
img(src:'http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Cdklogo.svg/500px-Cdklogo.svg.png',width:100)
h1('SuperNightly')
table() {
tr() {
td() { b('Node') }
td() { b('Location') }
td() { b('OS') }
td() { b('Java') }
td() { b('CDK Version') }
td() { b('Last Compile') }
td() { b('Unit tests') }
td() { b('Fails') }
td() { b('Errors') }
td() { b('PMD Violations') }
td() { b('OJDC Violations') }
}
nodes.node.@url.findAll { url ->
print "Processing " + url + "...\n"
def unit = null
try {
unit = new XmlParser().parseText(new URL(url + "junitsummary.html").content.text)
} catch (Exception exception) {}
def pmd = null
try {
pmd = new XmlParser().parseText(new URL(url + "pmdsummary.html").content.text)
} catch (Exception exception) {}
def nightly = null
try {
nightly = new XmlParser().parseText(new URL(url + "nightly.xml").content.text)
} catch (Exception exception) {}
def ojdc = null
try {
ojdc = new XmlParser().parseText(new URL(url + "ojdcheckSummary.html").content.text)
} catch (Exception exception) {}
tr() {
if (nightly != null) {
td() {
a(href:url, nightly.title.text())
}
if (url.contains("uu.se")) {
td("Uppsala");
} else if (url.contains("ebi.ac.uk")) {
td("EBI");
} else {
td();
}
td(nightly.operatingSystem.name.text() + ' ' + nightly.operatingSystem.version.text())
td(nightly.java.vendor.text() + ' ' + nightly.java.version.text())
td(nightly.cdk.'@version'.text())
td(nightly.date.text())
} else {
td() { a(href:url, url) };
if (url.contains("uu.se")) {
td("Uppsala");
} else if (url.contains("ebi.ac.uk")) {
td("EBI");
} else {
td();
}
td(); td(); td(); td()
}
if (unit != null) {
td(unit.depthFirst().grep{ it.'@class' == 'totalTest' }[0].text())
td(unit.depthFirst().grep{ it.'@class' == 'totalFail' }[0].text())
td(unit.depthFirst().grep{ it.'@class' == 'totalError' }[0].text())
} else { td(); td(); td() }
if (pmd != null) {
td(pmd.depthFirst().grep{ it.'@class' == 'total' }[0].text())
} else {
td()
}
if (ojdc != null) {
td(ojdc.depthFirst().grep{ it.'@class' == 'total' }[0].text())
} else {
td()
}
}
}
}
}
}
new File("super.html").text = writer.toString()