aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle31
1 files changed, 31 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index 60876c8..1d42616 100644
--- a/build.gradle
+++ b/build.gradle
@@ -75,3 +75,34 @@ tasks.withType(Checkstyle) {
configFile file('checkstyle.xml')
}
}
+
+tasks.register('uml') {
+ doFirst {
+ renderUML("all")
+ renderUML("type")
+ renderUML("assoc")
+ }
+
+ dependsOn project(':umlgen').build
+}
+
+ext.renderUML = { scope ->
+ def output = new ByteArrayOutputStream()
+ javaexec {
+ classpath = project(':umlgen').sourceSets.main.runtimeClasspath
+ mainClass = 'moe.yuuta.umlgen.Main'
+ standardOutput = output
+ args "${sourceSets.main.java.srcDirs[1]}", scope
+ }
+ def dot = output.toByteArray()
+ out.close()
+ def input = new ByteArrayInputStream(dot)
+ output = new FileOutputStream("${rootDir}/arts/uml.${scope}.pdf")
+ exec {
+ commandLine 'dot', '-Tpdf'
+ standardInput = input
+ standardOutput = output
+ }
+ input.close()
+ output.close()
+} \ No newline at end of file