-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
41 lines (33 loc) · 1.4 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
group 'com.pattern-match'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'application'
mainClassName = "com.patternmatch.WebServiceCaller"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile group: 'io.reactivex.rxjava2', name: 'rxjava', version: '2.1.13'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
GroovyScriptEngine gse() {
def pathToFolderOfToolScripts = "${projectDir}/tools/"
def gse = new GroovyScriptEngine([pathToFolderOfToolScripts] as String[])
gse
}
task genrx {
doLast {
def serviceDirValue = propertyOrDefault("serviceDir", "src/main/java/com/cdyne/ws")
def rxFileDirValue = propertyOrDefault("rxFileDir", "src/main/java/com/patternmatch")
def rxFileNameValue = propertyOrDefault("rxFileName", "Backend.java")
def rxFilePackageNameValue = propertyOrDefault("rxFilePackageName", "com.patternmatch")
gse().run('rx.groovy', new Binding(['serviceDir' : serviceDirValue,
'rxFileDir' : rxFileDirValue,
'rxFileName' : rxFileNameValue,
'rxFilePackageName': rxFilePackageNameValue]))
}
}
String propertyOrDefault(String propertyName, String defaultValue) {
project.hasProperty(propertyName) ? project.property(propertyName) : defaultValue
}