Skip to content

Commit 5853b0c

Browse files
author
Racci
committed
build(gradle): Use Minix-Conventions
1 parent 0d2167a commit 5853b0c

File tree

5 files changed

+48
-54
lines changed

5 files changed

+48
-54
lines changed

build.gradle.kts

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2-
31
plugins {
42
application
5-
6-
kotlin("jvm")
3+
id("dev.racci.minix.kotlin")
74
kotlin("plugin.serialization")
8-
95
id("com.github.johnrengelman.shadow")
106
}
117

12-
group = "dev.racci.elixir"
138
version = "1.0"
149

1510
repositories {
@@ -23,33 +18,27 @@ repositories {
2318

2419
dependencies {
2520

26-
implementation(libs.kord.extensions)
27-
implementation(libs.kord.phishing)
28-
implementation(libs.kotlin.stdlib)
21+
implementation(eLib.kord.extensions)
22+
implementation(eLib.kord.phishing)
23+
// implementation(libs.kotlin.stdlib)
2924

3025
// Logging dependencies
31-
implementation(libs.groovy)
32-
implementation(libs.logback)
33-
implementation(libs.logging)
26+
implementation(eLib.groovy)
27+
implementation(eLib.logback)
28+
implementation(eLib.logging)
3429

3530
// Tags
36-
implementation(libs.kotlinx.serialization)
37-
implementation(libs.kaml)
31+
implementation(libs.kotlinx.serialization.json)
32+
implementation(libs.kotlinx.serialization.kaml)
3833

39-
// TOML reader
4034
@Suppress("GradlePackageUpdate")
4135
implementation("com.github.jezza:toml:1.2")
4236

4337
// Github API
4438
implementation("org.kohsuke:github-api:1.301")
4539

4640
// Exposed
47-
implementation("org.jetbrains.exposed:exposed-core:0.37.3")
48-
implementation("org.jetbrains.exposed:exposed-dao:0.37.3")
49-
implementation("org.jetbrains.exposed:exposed-jdbc:0.37.3")
50-
51-
// Hikari
52-
implementation("com.zaxxer:HikariCP:5.0.1")
41+
implementation(libs.bundles.exposed)
5342

5443
// SQLite
5544
implementation("org.xerial:sqlite-jdbc:3.36.0.3")
@@ -60,9 +49,7 @@ application {
6049
mainClassName = "dev.racci.elixir.ElixirBotKt"
6150
}
6251

63-
tasks.withType<KotlinCompile> {
64-
kotlinOptions.jvmTarget = "17"
65-
52+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
6653
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
6754
}
6855

@@ -73,13 +60,3 @@ tasks.jar {
7360
)
7461
}
7562
}
76-
77-
// This is to fix an issue with pushing that I cannot seem to fix.
78-
tasks.create<Delete>("detekt") {
79-
80-
}
81-
82-
java {
83-
sourceCompatibility = JavaVersion.VERSION_17
84-
targetCompatibility = JavaVersion.VERSION_17
85-
}

gradle.properties

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# suppress inspection "UnusedProperty" for whole file
2-
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1536M
2+
group=dev.racci
3+
version=1.0
4+
addRunNumber=false
5+
kotlinVersion=1.6.10
6+
minixVersion=0.4.47
7+
minixConventions=1.6.10-47
8+
copyJar=false
9+
org.gradle.caching=true
10+
org.gradle.console=rich
311
org.gradle.parallel=true
412
kotlin.incremental=true

libs.versions.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
[versions]
2-
kotlin = "1.6.10" # Note: Plugin versions must be updated in the settings.gradle.kts too
32

43
groovy = "3.0.9"
54
kord-extensions = "1.5.1-SNAPSHOT"
65
logging = "2.1.21"
76
logback = "1.2.8"
87

9-
kotlinx-serialization = "1.3.2"
10-
kaml = "0.39.0"
11-
128
[libraries]
139
groovy = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" }
1410
kord-extensions = { module = "com.kotlindiscord.kord.extensions:kord-extensions", version.ref = "kord-extensions" }
1511
kord-phishing = { module = "com.kotlindiscord.kord.extensions:extra-phishing", version.ref = "kord-extensions" }
16-
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
1712
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
18-
logging = { module = "io.github.microutils:kotlin-logging", version.ref = "logging" }
19-
kotlinx-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
20-
kaml = { module = "com.charleskorn.kaml:kaml", version.ref = "kaml" }
13+
logging = { module = "io.github.microutils:kotlin-logging", version.ref = "logging" }

settings.gradle.kts

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
1+
enableFeaturePreview("VERSION_CATALOGS")
12
pluginManagement {
2-
plugins {
3-
// Update this in libs.version.toml when you change it here
4-
kotlin("jvm") version "1.6.10"
5-
kotlin("plugin.serialization") version "1.6.10"
3+
repositories {
4+
mavenCentral()
5+
gradlePluginPortal()
6+
maven("https://repo.racci.dev/releases")
7+
maven("https://papermc.io/repo/repository/maven-public/")
8+
}
69

7-
// Update this in libs.version.toml when you change it here
10+
plugins {
11+
val kotlinVersion: String by settings
12+
kotlin("plugin.serialization") version kotlinVersion
813
id("com.github.johnrengelman.shadow") version "7.1.2"
914
}
15+
val minixConventions: String by settings
16+
resolutionStrategy {
17+
eachPlugin {
18+
if (requested.id.id.startsWith("dev.racci.minix")) {
19+
useVersion(minixConventions)
20+
}
21+
}
22+
}
1023
}
1124

1225
rootProject.name = "ElixirBot"
1326

14-
enableFeaturePreview("VERSION_CATALOGS")
15-
1627
dependencyResolutionManagement {
28+
repositories {
29+
maven("https://repo.racci.dev/releases")
30+
}
31+
1732
versionCatalogs {
1833
create("libs") {
34+
val minixConventions: String by settings
35+
from("dev.racci:catalog:$minixConventions")
36+
}
37+
create("eLib") {
1938
from(files("libs.versions.toml"))
2039
}
2140
}
22-
}
41+
}

src/main/kotlin/dev/racci/elixir/ElixirBot.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ import java.nio.file.Files
3333
import java.nio.file.Path
3434
import java.nio.file.Paths
3535
import kotlin.properties.Delegates
36-
import mu.KotlinLogging
37-
import org.kohsuke.github.GitHub
38-
import org.kohsuke.github.GitHubBuilder
3936

4037
val configPath: Path = Paths.get(CONFIG_PATH)
4138
val config: TomlTable = Toml.from(Files.newInputStream(Paths.get("$configPath/config.toml")))

0 commit comments

Comments
 (0)