-
Notifications
You must be signed in to change notification settings - Fork 119
/
build.gradle
71 lines (56 loc) · 1.49 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
mainClassName = 'com.packtpub.reactive.chapter01.ReactiveSumV1'
sourceCompatibility = 1.8
version = '1.1'
jar {
manifest {
attributes 'Implementation-Title': 'Reactive Java Examples', 'Implementation-Version': version
}
}
run {
standardInput = System.in
}
repositories {
mavenCentral()
}
dependencies {
compile 'io.reactivex:rxjava:1.0.8'
compile 'io.reactivex:rxapache-http:0.21.0'
compile 'com.google.code.gson:gson:2.3.1'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
test {
systemProperties 'property': 'value'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
task (execute, dependsOn: 'classes') << {
def cl = 'com.packtpub.reactive.chapter0' + chapter + '.' + example
def classpath = sourceSets.main.runtimeClasspath
def command = [
'java',
'-ea',
'-cp', classpath.collect().join(System.getProperty('path.separator')),
cl,
'--color'
]
def proc = new ProcessBuilder(command)
.redirectOutput(ProcessBuilder.Redirect.INHERIT)
.redirectInput(ProcessBuilder.Redirect.INHERIT)
.redirectError(ProcessBuilder.Redirect.INHERIT)
.start()
proc.waitFor()
if (0 != proc.exitValue()) {
throw new RuntimeException("Program exited with status: ${proc.exitValue()}!")
}
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}