forked from opensciencemap/vtm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jdee.gradle
72 lines (60 loc) · 1.84 KB
/
jdee.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
def prj = { project ->
"(jde-project-file-version" (["1.0"])
"(jde-set-variables" {
"'(jde-compile-option-directory" ([project.sourceSets.main.output.classesDir])
"'(jde-junit-working-directory" ([project.projectDir])
"'(jde-compile-option-source" {
"'(" (["default"])
}
"'(jde-compile-option-target" {
"'(" (["default"])
}
"'(jde-compile-option-command-line-args" {
"'(" (["-${project.sourceCompatibility}"])
}
"'(jde-sourcepath" {
"'(" (
project.sourceSets.main.allSource.srcDirs
+ project.sourceSets.test.allSource.srcDirs)
}
"'(jde-global-classpath" {
"'(" (
[] + project.sourceSets.main.output.classesDir
+ project.sourceSets.test.output.classesDir
+ project.sourceSets.main.allSource.srcDirs
+ project.sourceSets.test.allSource.srcDirs
+ (([] as Set) + project.configurations.compile.getFiles()
+ project.configurations.testCompile.getFiles()))
}
}
}
subprojects {
task("jdee") << {
def output = new File(project.projectDir, "prj.el").newPrintWriter()
try {
prj.delegate = new NodeBuilder() {
def lev = 0
def write = { Object file ->
output.print '\n' + ''.padRight(lev, ' ') + "\"${file}\"".tr('\\', '/')
}
Object createNode(Object name) {
output.print '\n' + ''.padRight(lev++, ' ') + name
return name
}
Object createNode(Object name, Object value) {
createNode(name)
value.each write
return name
}
void nodeCompleted(Object parent, Object child) {
output.print ")"
lev--
}
}
prj(project)
output.close()
} finally {
output.flush()
}
}
}