aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorYuuta Liang <yuutaw@student.cs.ubc.ca>2023-11-28 21:00:25 -0800
committerYuuta Liang <yuutaw@student.cs.ubc.ca>2023-11-28 21:00:25 -0800
commitc992db275494b05627248cd741adac5d7c199603 (patch)
treef259bb943512007cbc9b50ddf8013d6e3f8b9008 /build.gradle
parent1073af21305360bd33903c533cdac57e9f936294 (diff)
downloadjca-c992db275494b05627248cd741adac5d7c199603.tar
jca-c992db275494b05627248cd741adac5d7c199603.tar.gz
jca-c992db275494b05627248cd741adac5d7c199603.tar.bz2
jca-c992db275494b05627248cd741adac5d7c199603.zip
Add UML generator
Signed-off-by: Yuuta Liang <yuutaw@student.cs.ubc.ca>
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