Skip to content

Commit

Permalink
Update dependencies, allow CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Sep 21, 2023
1 parent 83ae149 commit d7683c9
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 18 deletions.
7 changes: 4 additions & 3 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("com.google.cloud.tools.jib") version "3.2.1"
id("com.google.cloud.tools.jib") version "3.3.2"
}

repositories {
Expand All @@ -18,6 +18,7 @@ dependencies {
implementation(libs.ktor.server.netty)
implementation(libs.ktor.server.compression)
implementation(libs.ktor.server.caching.headers)
implementation(libs.ktor.server.cors)
implementation(libs.kotlinx.serialization.json)

implementation(project(":common"))
Expand Down Expand Up @@ -50,6 +51,6 @@ tasks.test {
useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlin {
jvmToolchain(17)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import io.ktor.server.engine.*
import io.ktor.server.netty.*
import io.ktor.server.plugins.cachingheaders.*
import io.ktor.server.plugins.compression.*
import io.ktor.server.plugins.cors.routing.*
import io.ktor.server.routing.*
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.sync.Mutex
Expand Down Expand Up @@ -108,6 +109,17 @@ class EtherealGambi {
}
}

// Useful to access and manipulate images in a canvas
install(CORS) {
anyHost()
allowMethod(HttpMethod.Get)
allowMethod(HttpMethod.Post)
allowMethod(HttpMethod.Options)
allowMethod(HttpMethod.Put)
allowMethod(HttpMethod.Patch)
allowMethod(HttpMethod.Delete)
}

routing {
for (route in routes) {
route.register(this)
Expand Down
10 changes: 2 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version libs.versions.kotlin apply false
kotlin("plugin.serialization") version libs.versions.kotlin apply false
}

group = "net.perfectdreams.etherealgambi"
version = "1.0-SNAPSHOT"
version = "1.0.1-SNAPSHOT"

allprojects {
group = "net.perfectdreams.etherealgambi"
version = "1.0.0"
version = "1.0.1"

repositories {
mavenCentral()
maven("https://repo.perfectdreams.net/")
}
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
4 changes: 4 additions & 0 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ publishing {
credentials(PasswordCredentials::class)
}
}
}

kotlin {
jvmToolchain(17)
}
4 changes: 4 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ publishing {
credentials(PasswordCredentials::class)
}
}
}

kotlin {
jvmToolchain(17)
}
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:17-slim-bullseye
FROM eclipse-temurin:20-jdk-jammy

# Install required dependencies
RUN apt-get update && apt-get install -y pngquant && apt-get clean && rm -rf /var/lib/apt/lists/*
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ include(":client")
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
val kotlin = version("kotlin", "1.6.21")
val kotlinXSerialization = version("kotlinx-serialization", "1.3.2")
val ktor = version("ktor", "2.0.2")
val kotlin = version("kotlin", "1.9.10")
val kotlinXSerialization = version("kotlinx-serialization", "1.6.0")
val ktor = version("ktor", "2.3.3")

library("kotlinx-coroutines-core", "org.jetbrains.kotlinx", "kotlinx-coroutines-core").version("1.6.1")
library("kotlin-logging", "io.github.microutils", "kotlin-logging").version("2.1.21")
library("kotlinx-coroutines-core", "org.jetbrains.kotlinx", "kotlinx-coroutines-core").version("1.7.3")
library("kotlin-logging", "io.github.microutils", "kotlin-logging").version("3.0.5")

library("kotlinx-serialization-core", "org.jetbrains.kotlinx", "kotlinx-serialization-core").versionRef(kotlinXSerialization)
library("kotlinx-serialization-json", "org.jetbrains.kotlinx", "kotlinx-serialization-json").versionRef(kotlinXSerialization)
Expand All @@ -23,6 +23,7 @@ dependencyResolutionManagement {
library("ktor-server-netty", "io.ktor", "ktor-server-netty").versionRef(ktor)
library("ktor-server-compression", "io.ktor", "ktor-server-compression").versionRef(ktor)
library("ktor-server-caching-headers", "io.ktor", "ktor-server-caching-headers").versionRef(ktor)
library("ktor-server-cors", "io.ktor", "ktor-server-cors").versionRef(ktor)
}
}
}

0 comments on commit d7683c9

Please sign in to comment.