forked from jonalv/cdk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
createModulePages.groovy
83 lines (77 loc) · 2.18 KB
/
createModulePages.groovy
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
#!/usr/bin/groovy
def nightly = "http://pele.farmbio.uu.se/nightly-1.2.x/"
ant = new AntBuilder()
ant.delete(dir:"doc/modules")
ant.mkdir(dir:"doc/modules")
def basedir = new File("src/META-INF")
files = basedir.listFiles().grep(~/.*cdkdepends$/)
files.add(new File(basedir,"annotation.cdkdepends"))
files.add(new File(basedir,"interfaces.cdkdepends"))
files.each {
file = it
m = (file =~ ~/\/([-|\w]*)\.cdkdepends/)
module = m[0][1]
def writer = new StringWriter()
def builder = new groovy.xml.MarkupBuilder(writer)
builder.html(){
head(){
title("CDK Module: " + module){}
}
body(){
h1("CDK Module: " + module)
if (!module.contains("test")) {
h2("QA Reports")
p(){
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) {}
}
}
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")
}
h2("Depends")
p(){
if (file.exists()) {
b("CDK")
file.text.eachLine{
dependency = (it =~ ~/cdk-([-|\w]*)\.jar/)[0][1]
a(href:dependency+".html", dependency)
}
}
}
libdepends = new File(basedir, module + ".libdepends")
p(){
if (libdepends.exists()) {
b("Libraries")
libdepends.text.eachLine{
span(it)
}
}
}
h2("Classes")
classes = new File("build/" + module + ".javafiles").text
classes.eachLine {
classURL = it.replaceAll(/.java/,"")
clazz = classURL.replaceAll(/\//,".")
a(href:nightly+"api/"+classURL+".html", clazz)
br()
}
}
}
new File("doc/modules/" + module + ".html").write(writer.toString())
}