Skip to content

Instantly share code, notes, and snippets.

@mikesorae
Created April 7, 2020 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesorae/50aefd427069fa43886aab65d491ff98 to your computer and use it in GitHub Desktop.
Save mikesorae/50aefd427069fa43886aab65d491ff98 to your computer and use it in GitHub Desktop.
build.gradle for Kotlin Apache Beam
buildscript {
ext.kotlin_version = '1.3.41'
ext.beam_version = '2.19.0'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "java"
id "application"
id "org.jetbrains.kotlin.jvm" version "1.3.41"
}
sourceCompatibility = "1.8"
application {
def className = project.hasProperty("mainClass") ? getProperty("mainClass") : "MyPipeline"
mainClassName = "com.example.${className}"
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
implementation "org.slf4j:slf4j-simple:1.7.26"
implementation "org.apache.beam:beam-sdks-java-core:$beam_version"
implementation "org.apache.beam:beam-sdks-java-extensions-sorter:$beam_version"
implementation "org.apache.beam:beam-runners-direct-java:$beam_version"
implementation "org.apache.beam:beam-runners-google-cloud-dataflow-java:$beam_version"
testCompile "junit:junit:4.11"
}
run {
if (project.hasProperty("args")) {
args project.args.split("\\s")
}
}
@mikesorae
Copy link
Author

gradle run -Pargs="--runner=DirectRunner --paramName=fooBar"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment