-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
76 lines (61 loc) · 1.61 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
buildscript {
repositories {
mavenLocal()
maven {
url 'https://maven-central.storage.googleapis.com'
}
mavenCentral()
jcenter()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4.1'
}
repositories {
mavenLocal()
maven {
url 'https://maven-central.storage.googleapis.com'
}
mavenCentral()
jcenter()
}
apply plugin: 'idea'
apply plugin: 'java'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
group = 'dataflow.examples'
version = '0.1'
configurations.all {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
dependencies {
compile 'org.apache.beam:beam-sdks-java-core:latest.release'
compile 'org.apache.beam:beam-runners-direct-java:latest.release'
compile 'org.apache.beam:beam-runners-google-cloud-dataflow-java:latest.release'
compile 'ch.qos.logback:logback-classic:1.2.3'
testCompile 'org.hamcrest:hamcrest-all:latest.release'
}
task runJob(type: JavaExec) {
def jobClass = getJobClass()
def options = getOptions()
classpath = sourceSets.main.runtimeClasspath
main = "${jobClass}"
args options
doFirst {
println "* main job class : ${jobClass}"
println "* pipeline options: \n${options.join("\n")}\n"
sleep(5000)
}
}
tasks.runJob.dependsOn 'compileJava'
def getJobClass() {
return project.hasProperty('jobClass') ? project.property('jobClass') : ''
}
// options: --KEY1=VALUE1 --KEY2=VALUE2
def getOptions() {
def m = []
if (!project.hasProperty('options')) {
return m
}
return project.property('options').split()
}