Skip to content

Commit

Permalink
chore: fix gradle & db issues
Browse files Browse the repository at this point in the history
  • Loading branch information
KurenaiRyu committed Aug 28, 2024
1 parent 223416c commit 54153e3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
30 changes: 14 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "3.1.0"
Expand Down Expand Up @@ -49,9 +48,19 @@ lombok {
version.set(Versions.LOMBOK)
}


kotlin {
compilerOptions {
languageVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_2_0)
freeCompilerArgs.set(
listOf(
"-Xjsr305=strict",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
)
)
javaParameters.set(true)
jvmTarget.set(JvmTarget.JVM_21)
}
}

Expand Down Expand Up @@ -90,7 +99,7 @@ dependencies {
implementation("com.linecorp.kotlin-jdsl:spring-data-kotlin-jdsl-starter-jakarta:2.2.0.RELEASE")

//db driver
runtimeOnly("org.hibernate.orm:hibernate-community-dialects:6.6.0.Final")
runtimeOnly("org.hibernate.orm:hibernate-community-dialects")
runtimeOnly("org.xerial:sqlite-jdbc")
// runtimeOnly("com.h2database:h2")
// runtimeOnly("mysql:mysql-connector-java")
Expand Down Expand Up @@ -176,17 +185,6 @@ java {
targetCompatibility = JavaVersion.VERSION_21
}

tasks.withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs = listOf(
"-Xjsr305=strict",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
)
javaParameters = true
jvmTarget = JvmTarget.JVM_21
}
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
Expand All @@ -213,8 +211,8 @@ tasks.test {
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.required = true
html.required = true
xml.required.set(true)
html.required.set(true)
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 0 additions & 4 deletions src/main/kotlin/kurenai/imsyncbot/utils/BotUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@ import it.tdlight.jni.TdApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.future.await
import kotlinx.coroutines.withContext
import kurenai.imsyncbot.bot.qq.QQBot
import kurenai.imsyncbot.domain.QQMessage
import kurenai.imsyncbot.exception.BotException
import kurenai.imsyncbot.snowFlake
import net.mamoe.mirai.Bot
import net.mamoe.mirai.event.Event
import net.mamoe.mirai.event.events.BotEvent
import net.mamoe.mirai.event.events.MessageEvent
import net.mamoe.mirai.message.data.MessageChain
import net.mamoe.mirai.message.data.MessageSource
import net.mamoe.mirai.message.data.MessageSourceBuilder
import net.mamoe.mirai.message.data.source
import top.mrxiaom.overflow.Overflow
import top.mrxiaom.overflow.OverflowAPI
import top.mrxiaom.overflow.contact.RemoteBot
import java.nio.file.Files
import java.nio.file.Path
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ spring:
active: dev
datasource:
# url: jdbc:h2:file:./data/im-sync-bot;AUTO_SERVER=TRUE
url: jdbc:sqlite:./data/im-sync-bot.db
url: jdbc:sqlite:im-sync-bot.db
driver-class-name: org.sqlite.JDBC
hikari:
auto-commit: false
im-sync-bot:
Expand Down

0 comments on commit 54153e3

Please sign in to comment.