-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
86 lines (74 loc) · 2.53 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
application
kotlin("jvm") version "1.4.31"
}
group = "org.example"
version = "1.0-SNAPSHOT"
application {
mainClass.set("ap.Application")
}
repositories {
mavenCentral()
}
val ktorVersion = "1.5.2"
val cdkVersion = "1.111.0"
dependencies {
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("software.amazon.awscdk:core:$cdkVersion")
implementation("software.amazon.awscdk:apigateway:$cdkVersion")
implementation("software.amazon.awscdk:lambda:$cdkVersion")
implementation("software.amazon.awscdk:cognito:$cdkVersion")
implementation("software.amazon.awscdk:s3:$cdkVersion")
implementation("software.amazon.awscdk:events-targets:$cdkVersion")
implementation("software.amazon.awscdk:lambda-event-sources:$cdkVersion")
implementation("software.amazon.awscdk:iam:$cdkVersion")
implementation("software.amazon.awscdk:route53:$cdkVersion")
implementation("com.amazonaws:aws-lambda-java-runtime-interface-client:1.0.0")
implementation("com.amazonaws:aws-lambda-java-core:1.2.1")
implementation("com.amazonaws:aws-lambda-java-events:3.2.0")
testImplementation("io.mockk:mockk:1.10.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testImplementation("io.ktor:ktor-client-core:$ktorVersion")
testImplementation("io.ktor:ktor-client-cio:$ktorVersion")
}
tasks {
withType<Test> {
useJUnitPlatform()
}
withType<KotlinCompile> {
kotlinOptions {
useIR = true
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
clean {
delete += setOf("build", "cdk.out", ".aws-sam")
}
register<Copy>("copyRuntimeDependencies") {
from(configurations.runtimeClasspath)
into("$buildDir/lambda/var/task/lib/")
}
register<Copy>("copyLambdaFunction") {
dependsOn("jar")
from("$buildDir/classes/kotlin/main")
into("$buildDir/lambda/var/task/")
}
register<Copy>("copyDockerFile") {
from("$rootDir/Dockerfile")
into("$buildDir/lambda")
}
register<Copy>("copyResources") {
from("$buildDir/resources")
into("$buildDir/lambda/resources")
}
getByName("build").dependsOn(
"copyResources",
"copyLambdaFunction",
"copyRuntimeDependencies",
"copyDockerFile"
)
}