Skip to content

Commit

Permalink
Upgrade to Spring 3.1.2 and JDK 17
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaFox161 committed Aug 19, 2023
1 parent 5844e26 commit cac34ee
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'DreamExposure/DisCal-Discord-Bot' }}
strategy:
matrix:
java: [ 16, 17 ]
java: [ 17 ]
steps:
- uses: actions/checkout@v2

Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ allprojects {
apply(plugin = "kotlin")

//Compiler nonsense
java.sourceCompatibility = JavaVersion.VERSION_16
java.targetCompatibility = JavaVersion.VERSION_16
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17

// Versions --- found in gradle.properties
val kotlinVersion: String by properties
Expand Down
2 changes: 1 addition & 1 deletion cam/src/main/kotlin/org/dreamexposure/discal/cam/Cam.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dreamexposure.discal.cam

import jakarta.annotation.PreDestroy
import org.dreamexposure.discal.Application
import org.dreamexposure.discal.cam.google.GoogleInternalAuthHandler
import org.dreamexposure.discal.core.config.Config
Expand All @@ -8,7 +9,6 @@ import org.dreamexposure.discal.core.logger.LOGGER
import org.dreamexposure.discal.core.utils.GlobalVal
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.stereotype.Component
import javax.annotation.PreDestroy
import kotlin.system.exitProcess

@Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
package org.dreamexposure.discal.client

import discord4j.core.GatewayDiscordClient
import jakarta.annotation.PreDestroy
import org.dreamexposure.discal.Application
import org.dreamexposure.discal.client.message.Messages
import org.dreamexposure.discal.core.config.Config
import org.dreamexposure.discal.core.logger.LOGGER
import org.dreamexposure.discal.core.utils.GlobalVal
import org.dreamexposure.discal.core.utils.GlobalVal.DEFAULT
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.stereotype.Component
import kotlin.system.exitProcess

@Component
class DisCalClient {

@PreDestroy
fun onShutdown(gatewayDiscordClient: GatewayDiscordClient) {
LOGGER.info(GlobalVal.STATUS, "Shutting down shard")

gatewayDiscordClient.logout().subscribe()
}

companion object {
@JvmStatic
fun main(args: Array<String>) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package org.dreamexposure.discal.core.spring

import kotlinx.serialization.SerializationException
import kotlinx.serialization.encodeToString
import org.dreamexposure.discal.core.`object`.rest.RestError
import org.dreamexposure.discal.core.exceptions.AccessRevokedException
import org.dreamexposure.discal.core.exceptions.AuthenticationException
import org.dreamexposure.discal.core.exceptions.NotFoundException
import org.dreamexposure.discal.core.exceptions.TeaPotException
import org.dreamexposure.discal.core.logger.LOGGER
import org.dreamexposure.discal.core.`object`.rest.RestError
import org.dreamexposure.discal.core.utils.GlobalVal
import org.springframework.beans.TypeMismatchException
import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler
Expand All @@ -27,7 +27,7 @@ class GlobalErrorHandler : ErrorWebExceptionHandler {
//Handle exceptions we have codes for
val restError: RestError = when (throwable) {
is ResponseStatusException -> {
when (throwable.status) {
when (throwable.statusCode) {
HttpStatus.NOT_FOUND -> {
exchange.response.statusCode = HttpStatus.NOT_FOUND
LOGGER.trace("404 exchange | Path: ${exchange.request.path}")
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
kotlinVersion=1.9.0

# Plugins
springDependencyManagementVersion=1.0.13.RELEASE
jibVersion=3.3.1
springDependencyManagementVersion=1.1.3
jibVersion=3.3.2
gitPropertiesVersion=2.4.1

# Buildscript tooling
kotlinPoetVersion=1.12.0
kotlinPoetVersion=1.14.2

# Tools
kotlinxCoroutinesReactorVersion=1.6.4
reactorKotlinExtensions=1.1.7

# Discord
discord4jVersion=3.2.3
discord4jVersion=3.2.5
discord4jStoresVersion=3.2.2
discordWebhookVersion=0.8.2

# Spring
springVersion=2.7.5
springVersion=3.1.2

# Thymeleaf
thymeleafVersion=3.1.0.M2
Expand All @@ -47,4 +47,4 @@ okhttpVersion=4.10.0
copyDownVersion=1.0

# Jib properties
baseImage=eclipse-temurin:16-jdk-alpine
baseImage=eclipse-temurin:17-jdk-alpine
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dreamexposure.discal.server

import jakarta.annotation.PreDestroy
import org.dreamexposure.discal.Application
import org.dreamexposure.discal.core.config.Config
import org.dreamexposure.discal.core.database.DatabaseManager
Expand All @@ -8,7 +9,6 @@ import org.dreamexposure.discal.core.utils.GlobalVal.DEFAULT
import org.dreamexposure.discal.core.utils.GlobalVal.STATUS
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.stereotype.Component
import javax.annotation.PreDestroy
import kotlin.system.exitProcess


Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pluginManagement {

// Spring
kotlin("plugin.spring") version kotlinVersion
id("org.springframework.boot") version springVersion apply false
id("io.spring.dependency-management") version springDependencyManagementVersion
id("org.springframework.boot") version springVersion apply false

// Tooling
id("com.gorylenko.gradle-git-properties") version gitPropertiesVersion apply false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.dreamexposure.discal.web

import jakarta.annotation.PreDestroy
import org.dreamexposure.discal.Application
import org.dreamexposure.discal.core.config.Config
import org.dreamexposure.discal.core.logger.LOGGER
import org.dreamexposure.discal.core.utils.GlobalVal.DEFAULT
import org.dreamexposure.discal.core.utils.GlobalVal.STATUS
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.stereotype.Component
import javax.annotation.PreDestroy
import kotlin.system.exitProcess

@Component
Expand Down

0 comments on commit cac34ee

Please sign in to comment.