-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
49 lines (43 loc) · 1.05 KB
/
build.gradle
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
plugins {
id 'java'
}
repositories {
jcenter()
}
dependencies {
implementation group: 'net.sourceforge.plantuml', name: 'plantuml', version: '1.2021.1'
}
def compile(type) {
def sources = fileTree(include:['**/*.puml'], dir:"src").collect()
sources
.each { f ->
def rel = f.absolutePath
.replace(project.projectDir.absolutePath, '')
.replace('/src/', '')
def dest = "${project.buildDir}/${f.parent.replace(project.projectDir.absolutePath, '').replace('/src/', '')}"
file(dest).mkdirs()
println rel
javaexec {
classpath sourceSets.main.runtimeClasspath
workingDir f.parentFile
main = 'net.sourceforge.plantuml.Run'
args = ['-o', dest, "-t${type}", f.name]
}
}
}
task png() {
doLast {
compile('png')
}
}
task svg() {
doLast {
compile('svg')
}
}
task stdlib(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
workingDir project.buildDir
main = 'net.sourceforge.plantuml.Run'
args = ['-extractstdlib']
}