-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
213 lines (181 loc) · 7.46 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
plugins {
// provides all necessary tasks (assemble, check, install) even though not necessary for the root project that are passed on to the subprojects
id 'org.xtext.xtend' version '2.0.1'
// no need to upload the root project itself, thus apply = false
id 'com.jfrog.bintray' version '1.8.4' apply false
// necessary to configure the release (tags)
id 'net.researchgate.release' version '2.7.0'
// allow eclipse project meta data generation
id 'eclipse'
}
release {
preTagCommitMessage = '[release]'
tagCommitMessage = '[release]'
newVersionCommitMessage = '[release] new version'
tagTemplate = 'v${version}'
}
subprojects {
apply plugin: 'maven' // necessary to publish maven artifacts
apply plugin: 'java'
apply plugin: 'org.xtext.xtend'
apply from: "${rootDir}/gradle/source-layout.gradle"
ext {
xtextVersion = '2.18.0'
coreFixtureVersion = '4.4.+'
// xtext framework dependencies fixed to working version set
emfCodegenVersion = '2.14.0'
mwe2LaunchVersion = '2.9.1.201705291010'
antlrGeneratorVersion = '[2.1.1, 3)'
antlrRuntime = '3.2'
emfEcoreVersion = '2.12.0'
emfEcoreCommonVersion = '2.12.0'
emfEcoreXcore = '1.7.0' // +
emfEcoreXcoreLib = '1.3.0' // +
codegenEcoreXtext = '1.4.0' // +
// used for testing
junitVersion = '4.12'
mockitoCoreVersion = '2.22.+'
// for project and generator functionality
gradleToolingApi = '4.3'
gsonVersion = '2.8.5'
jdtCoreVersion = '3.12.2'
// for (some) web projects
jettyAnnotations = '9.4.12.v20180830'
slf4jApi = '1.7.25'
log4jApi = '2.5'
}
repositories {
jcenter()
mavenCentral()
maven { url "http://dl.bintray.com/test-editor/maven/" }
}
group = 'org.testeditor'
sourceCompatibility = '1.10'
targetCompatibility = '1.10'
configurations.all {
exclude group: 'asm'
resolutionStrategy {
force "org.antlr:antlr-runtime:${antlrRuntime}"
force "org.eclipse.emf:org.eclipse.emf.ecore:${xtextVersion}"
}
}
test {
// configure logging within tests (see https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.logging.TestLogging.html)
// show standard out during test to see logging output
testLogging.showStandardStreams = true
// make sure that assertion failures are reported more verbose!
testLogging.exceptionFormat = 'full'
// report finished test with status
afterTest { desc, result ->
logger.quiet "${result.resultType}: ${desc.name} [${desc.className}]"
}
maxParallelForks = Runtime.runtime.availableProcessors() / 2
}
tasks.withType(JavaCompile) {
// options.compilerArgs << '-Xlint:unchecked'
}
}
// all sub projects are released, except those ending on '.testing'
configure(subprojects.findAll {!it.name.endsWith('.testing')}) {
apply from: "$rootDir/gradle/publishing.gradle"
}
// all sub projects depend on org.testeditor.loggong, except those ending on loggin!
configure(subprojects.findAll {!it.name.endsWith('.logging')}) {
dependencies {
compile project(':org.testeditor.logging')
}
}
// all sub projects depend on common.testing, except those project, ending on testing!
configure(subprojects.findAll {!it.name.endsWith('.testing')}) {
dependencies {
testCompile project(':org.testeditor.dsl.common.testing')
}
}
// all web sub projects depend on these libraries
configure(subprojects.findAll {it.name.endsWith('.web')}) {
dependencies {
compile "org.eclipse.xtext:org.eclipse.xtext.xbase.web:${xtextVersion}"
compile "org.eclipse.xtext:org.eclipse.xtext.web.servlet:${xtextVersion}"
compile "org.eclipse.xtend:org.eclipse.xtend.lib:${xtextVersion}"
// the compile references below are only necessary if a standalone web demo app should be functional, which is not necessary
// compile "org.webjars:requirejs:2.3.2"
// compile "org.webjars:jquery:2.2.+"
// compile "org.webjars:ace:1.2.3"
}
}
// all language generating sub projects depend on these libraries and run mwe2 tasks
configure(subprojects.findAll {it.name.endsWith('.dsl')}) {
dependencies {
compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}"
compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}"
testCompile project(':org.testeditor.dsl.common.testing')
testCompile "org.eclipse.xtext:org.eclipse.xtext.builder.standalone:${xtextVersion}"
testCompile "org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}"
testCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}"
}
configurations {
mwe2 {
extendsFrom compile
}
}
dependencies {
mwe2 "org.eclipse.emf:org.eclipse.emf.mwe2.launch:${mwe2LaunchVersion}"
mwe2 "org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}"
mwe2 "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}"
mwe2 "org.eclipse.xtext:xtext-antlr-generator:${antlrGeneratorVersion}"
// added for Xcore support
mwe2 "org.eclipse.emf:org.eclipse.emf.ecore.xcore:${emfEcoreXcore}"
mwe2 "org.eclipse.emf:org.eclipse.emf.codegen.ecore.xtext:${codegenEcoreXtext}"
}
}
// all xcore model sub projects have these dependencies, include the model source into the jar,
// and configure xtext to know about ecore, codegen and xcore!
configure(subprojects.findAll {it.name.endsWith('.model')}) {
dependencies {
compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}"
compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}"
compile "org.eclipse.emf:org.eclipse.emf.ecore.xcore.lib:${emfEcoreXcoreLib}" // +
xtextLanguages "org.eclipse.emf:org.eclipse.emf.common:${emfEcoreCommonVersion}"
xtextLanguages "org.eclipse.emf:org.eclipse.emf.ecore:${emfEcoreVersion}"
xtextLanguages "org.eclipse.emf:org.eclipse.emf.ecore.xcore:${emfEcoreXcore}"
xtextLanguages "org.eclipse.emf:org.eclipse.emf.ecore.xcore.lib:${emfEcoreXcoreLib}"
xtextLanguages "org.eclipse.emf:org.eclipse.emf.codegen:${emfCodegenVersion}"
xtextLanguages "org.eclipse.emf:org.eclipse.emf.codegen.ecore:${xtextVersion}"
xtextLanguages "org.eclipse.emf:org.eclipse.emf.codegen.ecore.xtext:${codegenEcoreXtext}"
xtextLanguages "org.eclipse.xtext:org.eclipse.xtext.ecore:${xtextVersion}"
xtextLanguages "org.eclipse.emf:org.eclipse.emf.mwe2.runtime:${mwe2LaunchVersion}"
}
sourceSets {
main {
resources {
exclude '**/*.xcore'
}
java {
srcDir 'build/xcore/main'
}
}
}
// include model xcore source into resulting jar
jar {
into('model') {
from('src/main/resources') {
include '**/*.xcore'
}
}
}
xtext {
version = "${xtextVersion}"
languages {
ecore {
setup = 'org.eclipse.xtext.ecore.EcoreSupport'
}
codegen {
setup = 'org.eclipse.emf.codegen.ecore.xtext.GenModelSupport'
}
xcore {
setup = 'org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup'
generator.outlet.producesJava = true
}
}
}
}