-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathbuild.gradle.kts
160 lines (137 loc) · 5.57 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import org.gradle.api.tasks.wrapper.Wrapper.DistributionType.ALL
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
//kotlin
kotlin("jvm")
kotlin("plugin.serialization")
id("org.jetbrains.kotlin.plugin.allopen")
// Spring
kotlin("plugin.spring")
id("org.springframework.boot")
id("io.spring.dependency-management")
//Tooling
id("com.gorylenko.gradle-git-properties") apply false
id("com.google.cloud.tools.jib") apply false
}
buildscript {
val kotlinPoetVersion: String by properties
dependencies {
classpath("com.squareup:kotlinpoet:$kotlinPoetVersion")
}
}
allprojects {
//Project props
group = "org.dreamexposure.discal"
version = "4.2.7"
description = "DisCal"
//Plugins
apply(plugin = "java")
apply(plugin = "kotlin")
apply(plugin = "io.spring.dependency-management")
// Versions --- found in gradle.properties
// Discord
val discord4jVersion: String by properties
val discord4jStoresVersion: String by properties
val discordWebhookVersion: String by properties
// Serialization
val kotlinxSerializationJsonVersion: String by properties
val orgJsonVersion: String by properties
// Observability
val logbackContribVersion: String by properties
// Google libs
val googleApiClientVersion: String by properties
val googleServicesCalendarVersion: String by properties
val googleOauthClientVersion: String by properties
// Various libs
val okhttpVersion: String by properties
val copyDownVersion: String by properties
val jsoupVersion: String by properties
repositories {
mavenCentral()
mavenLocal()
maven("https://repo.maven.apache.org/maven2/")
maven("https://kotlin.bintray.com/kotlinx")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://repo.spring.io/milestone")
maven("https://jitpack.io")
}
dependencies {
// Tools
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
// Discord
implementation("com.discord4j:discord4j-core:$discord4jVersion")
implementation("com.discord4j:stores-redis:$discord4jStoresVersion")
implementation("club.minnced:discord-webhooks:$discordWebhookVersion") {
// Due to vulnerability in older versions: https://github.com/advisories/GHSA-rm7j-f5g5-27vv
exclude(group = "org.json", module = "json")
}
// Spring
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("org.springframework.boot:spring-boot-starter-data-redis")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-cache")
implementation("org.springframework.boot:spring-boot-starter-actuator")
// Database
implementation("io.asyncer:r2dbc-mysql:1.3.0") // TODO: Remove hard coded version once spring includes this in bom as it is a breaking change
implementation("com.mysql:mysql-connector-j")
// Serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationJsonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("org.json:json:$orgJsonVersion")
// Observability
implementation("ch.qos.logback.contrib:logback-json-classic:$logbackContribVersion")
implementation("ch.qos.logback.contrib:logback-jackson:$logbackContribVersion")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation("io.projectreactor:reactor-core-micrometer")
// Google libs
implementation("com.google.api-client:google-api-client:$googleApiClientVersion")
implementation("com.google.apis:google-api-services-calendar:$googleServicesCalendarVersion")
implementation("com.google.oauth-client:google-oauth-client-jetty:$googleOauthClientVersion") {
exclude(group = "org.mortbay.jetty", module = "servlet-api")
}
// Various Libs
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:okhttp-coroutines:$okhttpVersion")
implementation("io.github.furstenheim:copy_down:$copyDownVersion")
implementation("org.jsoup:jsoup:$jsoupVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
sourceSets {
all {
languageSettings {
optIn("kotlinx.serialization.ExperimentalSerializationApi")
optIn("kotlin.RequiresOptIn")
}
}
}
}
}
subprojects {
tasks {
withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs.set(listOf("-Xjsr305=strict"))
jvmTarget.set(JvmTarget.fromTarget(java.targetCompatibility.majorVersion))
}
}
}
}
tasks {
wrapper {
distributionType = ALL
gradleVersion = "8.10.2"
}
bootJar {
enabled = false
}
}