-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
102 lines (84 loc) · 3.34 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.ByteArrayOutputStream
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.jetbrains.kotlin.jvm") version "2.0.0"
id("com.diffplug.spotless") version "7.0.0.BETA1"
}
repositories {
mavenCentral()
}
val awsSdkVersion = "1.12.760"
val log4jVersion = "2.23.1"
dependencies {
implementation("com.amazonaws:aws-java-sdk-dynamodb:$awsSdkVersion")
implementation("com.amazonaws:aws-java-sdk-s3:$awsSdkVersion")
implementation("com.amazonaws:aws-java-sdk-ses:$awsSdkVersion")
implementation("com.amazonaws:aws-java-sdk-sns:$awsSdkVersion")
implementation("com.amazonaws:aws-lambda-java-core:1.2.3")
implementation("com.fatboyindustrial.gson-javatime-serialisers:gson-javatime-serialisers:1.1.2")
implementation("com.google.code.gson:gson:2.10.1")
implementation("org.danilopianini:gson-extras:1.3.0")
implementation("com.google.guava:guava:33.2.1-jre")
implementation("com.google.auth:google-auth-library-oauth2-http:1.23.0")
implementation("com.google.apis:google-api-services-calendar:v3-rev20231123-2.0.0")
implementation("net.sf.biweekly:biweekly:0.6.8")
implementation("org.apache.commons:commons-email:1.5")
implementation("org.jsoup:jsoup:1.17.2")
implementation("org.apache.commons:commons-configuration2:2.10.1")
implementation("com.opencsv:opencsv:5.9")
implementation(kotlin("reflect"))
implementation("io.github.microutils:kotlin-logging:3.0.5")
implementation("org.apache.logging.log4j:log4j-core:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-jcl:$log4jVersion")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
testImplementation("com.google.truth:truth:1.4.2")
testImplementation("org.reflections:reflections:0.10.2")
}
spotless {
kotlin {
ktlint()
.editorConfigOverride(
mapOf(
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled",
"ij_kotlin_packages_to_use_import_on_demand" to null
)
)
}
}
tasks.withType<KotlinCompile>().all {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
allWarningsAsErrors.set(true)
}
dependsOn("generateGitShaConstant")
}
tasks.withType<Test> {
useJUnitPlatform()
}
val gitShaOutputDir = file("${layout.buildDirectory.get()}/generated/git-sha")
sourceSets["main"].java.srcDir(gitShaOutputDir)
tasks.register("generateGitShaConstant") {
doFirst {
val srcFile = File(gitShaOutputDir, "com/parmet/squashlambdas/GitSha.kt")
srcFile.parentFile.mkdirs()
srcFile.writeText(
"""
package com.parmet.squashlambdas
const val GIT_SHA = "${getGitSha()}"
""".trimIndent()
)
}
}
fun getGitSha(): String {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
return stdout.toString().trim()
}