-
Notifications
You must be signed in to change notification settings - Fork 0
/
eclipse.gradle
66 lines (56 loc) · 1.93 KB
/
eclipse.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
ext { aptDir='.apt_generated' }
eclipse {
// jdt.file.withProperties { it['org.eclipse.jdt.core.compiler.processAnnotations'] = 'enabled' }
// classpath {
// containers = [
// 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
// ]
// }
}
eclipseJdt {
def clos = []
def fp = file('.factorypath')
outputs.file fp
clos += {
fp.withWriter {
def domaJar = configurations.compile.find {
it.name.startsWith('doma-2')
}
new groovy.xml.MarkupBuilder(it).factorypath() {
factorypathentry(kind:'EXTJAR', id:domaJar, enabled:true, runInBatchMode:false)
}
}
}
def prefs = { name, contents ->
def f = file(".settings/$name")
clos += {
f.text = contents.stripMargin()
}
outputs.file f
}
prefs 'org.eclipse.jdt.apt.core.prefs', """\
|eclipse.preferences.version=1
|org.eclipse.jdt.apt.aptEnabled=true
|org.eclipse.jdt.apt.genSrcDir=${aptDir}
|org.eclipse.jdt.apt.processorOptions/
|org.eclipse.jdt.apt.reconcileEnabled=true
|"""
doLast { clos*.run() }
}
task eclipseSettings(type: Copy) {
from rootProject.files("eclipse/org.eclipse.jdt.ui.prefs")
into project.file('.settings/')
outputs.upToDateWhen { false }
}
task eclipseJdtPrepare(type: Copy) {
from rootProject.file("eclipse/org.eclipse.jdt.core.prefs")
into project.file(".settings/")
outputs.upToDateWhen { false }
}
task cleanEclipseJdtUi(type: Delete) {
// delete project.file(".settings/org.eclipse.jdt.ui.prefs")
// delete project.file(".settings/org.eclipse.jdt.core.prefs")
}
tasks["eclipseJdt"].dependsOn(eclipseJdtPrepare)
tasks["cleanEclipse"].dependsOn(cleanEclipseJdtUi)
tasks["eclipse"].dependsOn(eclipseSettings)