-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
56 lines (47 loc) · 1.67 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
import java.lang.invoke.MethodHandles.invoker
val invoker by configurations.creating
plugins {
id("org.jetbrains.kotlin.jvm") version "1.3.72"
id("com.github.johnrengelman.shadow") version "6.0.0"
application
}
repositories {
jcenter()
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("io.github.microutils:kotlin-logging:1.11.5")
implementation("com.google.cloud.functions:functions-framework-api:1.0.1")
invoker("com.google.cloud.functions.invoker:java-function-invoker:1.0.0-alpha-2-rc5")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("org.mockito:mockito-core:3.5.10")
testImplementation("com.google.truth:truth:1.0.1")
testImplementation("com.google.guava:guava-testlib:29.0-jre")
}
application {
mainClassName = "dev.mwhyte.function.AppKt"
}
task<JavaExec>("runFunction") {
main = "com.google.cloud.functions.invoker.runner.Invoker"
classpath(invoker)
inputs.files(configurations.runtimeClasspath, sourceSets["main"].output)
args(
"--target", project.findProperty("runFunction.target") ?: "dev.mwhyte.function.App",
"--port", project.findProperty("runFunction.port") ?: 8080
)
doFirst {
args("--classpath", files(configurations.runtimeClasspath, sourceSets["main"].output).asPath)
}
}
tasks.named("build") {
dependsOn(":shadowJar")
}
task("buildFunction") {
dependsOn("build")
copy {
from("build/libs/" + rootProject.name + "-all.jar")
into("build/deploy")
}
}