-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
75 lines (58 loc) · 2 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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
}
repositories {
mavenCentral()
}
subprojects {
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'application'
group = 'tech.fearless.purpledatahacks'
version = '1.0.0'
repositories {
mavenCentral()
}
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions.jvmTarget = '17'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '17'
}
}
def nonFunctionSubmodules = ['DataPrep', 'CommonMessages']
configure(subprojects.findAll { !nonFunctionSubmodules.contains(it.name) }) {
apply plugin: 'com.github.johnrengelman.shadow'
configurations {
invoker
}
shadowJar {
mergeServiceFiles()
}
dependencies {
// Every function needs this dependency to get the Functions Framework API.
implementation 'com.google.cloud.functions:functions-framework-api:1.0.4'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0'
implementation 'io.github.microutils:kotlin-logging:3.0.4'
implementation 'org.slf4j:slf4j-simple:2.0.5'
// To run function locally using Functions Framework's local invoker
invoker 'com.google.cloud.functions.invoker:java-function-invoker:1.1.1'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'com.google.cloud.functions:functions-framework-api:1.0.4'
}
task("buildFunction", type: Copy) {
group = "build"
dependsOn(tasks.shadowJar)
from("$buildDir/libs/${project.name}-${project.version}-all.jar")
into("$buildDir/../../deploy-${project.name}/")
}
task("removeDeployFiles", type: Delete) {
group = "build"
delete("$buildDir/../../deploy-${project.name}/")
}
tasks.clean.dependsOn(tasks.removeDeployFiles)
}