-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
73 lines (62 loc) · 1.91 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
plugins {
id("java")
id("com.diffplug.spotless") version "6.25.0"
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation("com.amazonaws:aws-lambda-java-core:1.2.2")
implementation("com.amazonaws:aws-lambda-java-events:3.11.2")
runtimeOnly("com.amazonaws:aws-lambda-java-log4j2:1.5.1")
testImplementation(platform("org.junit:junit-bom:5.9.3"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.assertj:assertj-core:3.24.2")
// Kotlin
//testImplementation(kotlin("test"))
}
spotless {
java {
removeUnusedImports()
palantirJavaFormat()
formatAnnotations()
}
}
tasks.test {
useJUnitPlatform()
}
val buildAppZip = tasks.register<Zip>("buildAppZip") {
group = "build"
description = "Packages the application into a single app JAR."
dependsOn(tasks.jar)
archiveBaseName.set("app")
into("lib") {
from(tasks.jar)
}
}
val buildDepsZip = tasks.register<Zip>("buildDepsZip") {
group = "build"
description = "Packages runtime dependencies into a single deps JAR."
archiveBaseName.set("deps")
into("java/lib/") {
from(configurations.runtimeClasspath)
}
}
val buildUberZip = tasks.register<Zip>("buildUberZip") {
dependsOn(tasks.jar)
// This task is currently unused, but here for your convenience. You might be interested in switching from the
// app+lib layer approach used by default; this task will create a single JAR containing both the application
// and its dependencies.
into("lib") {
from(tasks.jar)
from(configurations.runtimeClasspath)
}
}
tasks.register("buildZip") {
group = "build"
description = "Packages application and dependencies into JARs, ready for deployment."
dependsOn(buildAppZip, buildDepsZip)
}