-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
341 lines (261 loc) · 10.2 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
description = "Ceylon Dart Backend"
allprojects {
group = 'com.vasileff.ceylon.dart'
version = '0.0.1'
repositories {
mavenLocal()
mavenCentral()
}
}
apply plugin: 'base'
ext.ceylonRepoDir = System.getProperty("user.home") + "/.ceylon/repo"
ext.ceylonBinDir = System.getProperty("user.home") + "/.ceylon/bin"
task cleanAll(dependsOn: [
"ceylon-dart-ant:clean",
"ceylon-dart-ant:cleanEclipse",
"ceylon-dart-compiler:clean"
])
task reset(dependsOn: ["cleanAll", "ceylon-dart-ant:eclipse"]) {
group = 'Housekeeping'
description = 'Clean and rebuild eclipse and project settings; useful after switching git branches.'
}
project('ceylon-dart-compiler') {
description = "Ceylon Dart Backend Compiler"
apply plugin: 'ceylon'
defaultTasks 'compileCeylon'
compileCeylon {
// standard is src/main/ceylon
sourceDir file("source")
}
ceylonDoc {
includeSource true
includeNonShared false
ignoreMissingDoc true
ignoreMissingThrows true
// FIXME hack to make ceylon doc not crash.
// Currently, ceylon doc requires the output
// directory be the same as the compile directory
// if Java classes are present in the source
destinationDir = compileCeylon.destinationDir
}
// TODO plugin should create ceylonTest
task ceylonTest(type: CeylonTestTask) {
dependsOn compileCeylon
report = true
module "test.com.vasileff.ceylon.dart.compiler/1.3.2-DP5-SNAPSHOT"
test "test.com.vasileff.ceylon.dart.compiler"
}
task install {
group "Deployment"
description "Install plugins and copy the compiled modules to the user's repository"
dependsOn "publish"
}
task publish(type: Copy) {
group "Deployment"
description "Copy the compiled modules to the user's repository"
// ceylonDoc is too slow, disabling
//dependsOn "ceylonDoc"
dependsOn "compileCeylon"
//from ceylonDoc.destinationDir
from compileCeylon.destinationDir
into ceylonRepoDir
}
task test {
dependsOn ceylonTest;
}
build.dependsOn test;
}
project('ceylon-dart-ant') {
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply from: "$rootDir/buildSrc/eclipse.gradle" // customize eclipse plugin
apply from: "$rootDir/buildSrc/artifacts.gradle" // sourcesJar and javadocJar
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencies {
compile "org.apache.ant:ant:1.9.6"
}
task refresh {
group = 'Housekeeping'
description = 'Create directories, update genenerated files, etc; useful when working with IDEs.'
}
}
project('ceylon-dart-language') {
apply plugin: 'base'
task compileCeylonDart(type:Exec) {
group "Build"
description "Compile the 'main' Ceylon modules."
// Use the "bootstrap" compiler since we have to compile the sdk before
// the cli, so we can include the language module in the cli module for
// `ceylon install-dart`.
// TODO depend on the project artifacts, not the task
dependsOn project(":ceylon-dart-compiler").compileCeylon
inputs.dir project(":ceylon-dart-compiler").compileCeylon.destinationDir
ext.destinationDir = file("build/modules-dart/main")
ext.sourceDir = file("source")
ext.sourceDir2 = file("support")
inputs.dir sourceDir
inputs.dir sourceDir2
outputs.dir destinationDir
String repository = project(':ceylon-dart-compiler')
.compileCeylon.destinationDir.toString();
workingDir projectDir
commandLine 'ceylon', 'run',
'--rep', repository,
'--run', 'com.vasileff.ceylon.dart.compiler::bootstrapCompile',
'com.vasileff.ceylon.dart.compiler/1.3.2-DP5-SNAPSHOT',
"${sourceDir.toString()}:${sourceDir2.toString()}",
"${destinationDir.toString()}",
file("modules-dart")
}
task repositoryZip(type: Zip) {
dependsOn compileCeylonDart
// pre-generated dart models
from file("modules-dart")
// language and language support modules
from compileCeylonDart.destinationDir
into('repository')
}
project.assemble.dependsOn compileCeylonDart
project.assemble.dependsOn repositoryZip
task install {
group "Deployment"
description "Install plugins and copy the compiled modules to the user's repository"
dependsOn "publish"
}
task publish(type: Copy) {
group "Deployment"
description "Copy the compiled modules to the user's repository"
dependsOn "compileCeylonDart"
from compileCeylonDart.destinationDir
from file("modules-dart")
into ceylonRepoDir
}
}
project('ceylon-dart-sdk') {
apply plugin: 'base'
task compileCeylonDart(type:Exec) {
group "Build"
description "Compile the 'main' Ceylon modules."
// Use the "bootstrap" compiler since we have to compile the sdk before
// the cli, so we can include the sdk modules in the cli module for
// `ceylon install-dart`.
// TODO depend on the project artifacts, not the task
dependsOn project(":ceylon-dart-language").compileCeylonDart
inputs.dir project(":ceylon-dart-language").compileCeylonDart.destinationDir
ext.destinationDir = file("build/modules-dart/main")
ext.sourceDir = file("source")
inputs.dir sourceDir
outputs.dir destinationDir
String repository = project(':ceylon-dart-compiler')
.compileCeylon.destinationDir.toString();
workingDir projectDir
commandLine 'ceylon', 'run',
'--rep', repository,
'--run', 'com.vasileff.ceylon.dart.compiler::bootstrapCompile',
'com.vasileff.ceylon.dart.compiler/1.3.2-DP5-SNAPSHOT',
"${sourceDir.toString()}",
"${destinationDir.toString()}",
project(":ceylon-dart-language").compileCeylonDart.destinationDir,
file("../ceylon-dart-language/modules-dart")
}
task repositoryZip(type: Zip) {
dependsOn compileCeylonDart
from compileCeylonDart.destinationDir
into('repository')
}
project.assemble.dependsOn compileCeylonDart
project.assemble.dependsOn repositoryZip
task install {
group "Deployment"
description "Install plugins and copy the compiled modules to the user's repository"
dependsOn "publish"
}
task publish(type: Copy) {
group "Deployment"
description "Copy the compiled modules to the user's repository"
dependsOn "compileCeylonDart"
from compileCeylonDart.destinationDir
into ceylonRepoDir
}
}
project('ceylon-dart-cli') {
description = "Ceylon Dart Commandline Interface"
apply plugin: 'ceylon'
defaultTasks 'compileCeylon'
ext.generatedResourceDir = file("build/resource")
task prepareResourcesLM(type: Copy) {
dependsOn project(":ceylon-dart-language").repositoryZip
from file(project(":ceylon-dart-language").repositoryZip.archivePath)
into file(generatedResourceDir.toString() + "/com/vasileff/ceylon/dart/cli")
rename '.*', 'ceylon-language.zip'
}
task prepareResourcesSDK(type: Copy) {
dependsOn project(":ceylon-dart-sdk").repositoryZip
from file(project(":ceylon-dart-sdk").repositoryZip.archivePath)
into file(generatedResourceDir.toString() + "/com/vasileff/ceylon/dart/cli")
rename '.*', 'ceylon-sdk.zip'
}
compileCeylon {
dependsOn prepareResourcesLM
dependsOn prepareResourcesSDK
// standard is src/main/ceylon
sourceDir file("source")
// include the language module as a resource
resourceDir generatedResourceDir
// add dependency, and auto-config input repository!
dependsOn project(":ceylon-dart-compiler").compileCeylon
}
ceylonDoc {
includeSource true
includeNonShared false
ignoreMissingDoc true
ignoreMissingThrows true
// TODO this shouldn't be necessary
repository project(":ceylon-dart-compiler").compileCeylon.destinationDir
// For now, just output everything to the same repository since 'ceylon copy'
// doesn't work well when fed multiple '--rep' options.
destinationDir = compileCeylon.destinationDir
}
// TODO plugin should create ceylonPluginPack
task ceylonPluginPack(type: CeylonPluginPackTask) {
// For now, just output everything to the same repository since 'ceylon copy'
// doesn't work well when fed multiple '--rep' options.
destinationDir = compileCeylon.destinationDir
scriptDir file("script")
module "com.vasileff.ceylon.dart.cli"
}
project.assemble.dependsOn ceylonPluginPack
task install(type: Copy) {
group "Deployment"
description "Install plugins and copy the compiled modules to the user's repository"
dependsOn "publish"
from(file("script/com/vasileff/ceylon/dart/cli")) {
include "ceylon-install-dart.plugin"
include "ceylon-compile-dart.plugin"
include "ceylon-assemble-dart.plugin"
include "ceylon-run-dart.plugin"
}
into ceylonBinDir + "/com.vasileff.ceylon.dart.cli"
}
task publish(type: Copy) {
group "Deployment"
description "Copy the compiled modules to the user's repository"
dependsOn "compileCeylon"
// ceylonDoc is too slow, disabling
//dependsOn "ceylonDoc"
dependsOn "ceylonPluginPack"
//from ceylonDoc.destinationDir
from compileCeylon.destinationDir
from ceylonPluginPack.destinationDir
into ceylonRepoDir
}
}
// TODO don't require install for tests to work
// need to pass repository
// project(":ceylon-dart-language").file("build/modules-dart/main")
// to testCompile(), testModuleCompile()
project('ceylon-dart-compiler').ceylonTest {
dependsOn project(":ceylon-dart-language").install
//dependsOn project(":ceylon-dart-language").compileCeylonDart
}