-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
123 lines (103 loc) · 2.55 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
plugins {
id 'com.github.ben-manes.versions' version '0.27.0' apply false
}
def eclipseFiles = "$rootDir/eclipse"
def buildshipPrefFile = "org.eclipse.buildship.core.prefs"
allprojects {
/*
* Within 'subprojects {}', the Gradle 'plugins {}' block cannot be used yet, see
* https://docs.gradle.org/current/userguide/plugins.html#N12EB3
*/
// TODO: Replace with 'plugins {}' block
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'java-library'
sourceCompatibility = 1.8
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true
options.forkOptions.executable = 'javac'
}
repositories {
mavenCentral()
}
tasks.eclipse.dependsOn(cleanEclipse)
cleanEclipse {
doLast {
for(File f : fileTree("$eclipseFiles"){include '*.prefs'}.getFiles()) {
delete "$projectDir/.settings/"+f.name
}
}
}
eclipse.classpath {
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
containers 'org.springsource.ide.eclipse.gradle.classpathcontainer'
}
eclipse.project {
natures 'org.eclipse.buildship.core.gradleprojectnature'
buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
natures 'org.springsource.ide.eclipse.gradle.core.nature'
}
eclipseJdt {
doLast {
// install Buildship preference files
project.copy {
from(eclipseFiles) {
include buildshipPrefFile
}
into '.settings'
expand(projectPath: "\\:$project.name")
filteringCharset = 'UTF-8'
}
}
}
}
subprojects {
apply plugin: 'com.github.ben-manes.versions'
repositories {
mavenCentral()
flatDir {
dirs '../G3Utils/libs'
}
flatDir {
dirs '../LrentNode/libs'
}
}
def cpAttributesNode = new NodeBuilder().attributes {
attribute(name:'FROM_GRADLE_MODEL', value:true)
}
eclipse.classpath {
file {
whenMerged { classpath ->
classpath.entries.each { entry ->
if(entry.kind == 'con' && entry.path.startsWith('org.eclipse.jdt.launching.JRE_CONTAINER'))
entry.path = 'org.eclipse.jdt.launching.JRE_CONTAINER'
}
}
withXml { xml ->
xml.asNode().value().stream().filter { entry ->
entry.attribute('kind') == 'src'
}.forEach { entry ->
entry.append(cpAttributesNode)
}
}
}
}
eclipse.project {
natures 'org.eclipse.jdt.core.javanature'
buildCommand 'org.eclipse.jdt.core.javabuilder'
}
eclipseJdt {
doLast {
// install Eclipse preference files
project.copy {
from(eclipseFiles) {
include '*.prefs'
exclude buildshipPrefFile
}
into '.settings'
}
}
}
}