-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
68 lines (58 loc) · 1.69 KB
/
build.gradle.kts
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
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
jcenter()
}
dependencies {
// pin 1.2.41 since the latest version has a bug
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.41")
}
}
val wrapper by tasks.creating(Wrapper::class) {
gradleVersion = "4.9"
}
repositories {
mavenLocal()
google()
mavenCentral()
jcenter()
}
plugins {
kotlin("jvm") version "1.2.0"
java
idea
`maven-publish`
`kotlin-dsl`
}
group = "apachebeam-kotlin"
version = "1.0.0"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
compile(kotlin("stdlib"))
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.41")
compile("org.jetbrains.kotlin:kotlin-reflect:1.2.41")
compile("ch.qos.logback:logback-classic:1.2.3")
compile("org.apache.beam:beam-sdks-java-core:2.6.0")
compile("org.apache.beam:beam-runners-direct-java:2.6.0")
compile("org.apache.beam:beam-runners-google-cloud-dataflow-java:2.6.0")
testCompile("org.jetbrains.kotlin:kotlin-test-junit:1.2.41")
testCompile("org.hamcrest:hamcrest-all:1.3")
}
val jobClass: Any? by project
val options: Any? by project
val runJob by tasks.creating(JavaExec::class) {
val opts = options?.let { (it as String).split(Regex("(\n|\\s)")) }?.filter{ it.isNotBlank() }?.map { it.trim() } ?: listOf()
args = opts
main = "$jobClass"
classpath = java.sourceSets["main"].runtimeClasspath
doFirst {
println("* main job class : $jobClass")
println("* pipeline options: \n${opts.joinToString("\n")}\n")
}
}
runJob.dependsOn("compileKotlin")