From 14eb3f26a8fdf2660418631d7ac7fb9333e7a91d Mon Sep 17 00:00:00 2001 From: CloudS3c Date: Sun, 18 Jun 2023 16:28:37 +0200 Subject: [PATCH] Test --- .idea/compiler.xml | 6 ++ .idea/gradle.xml | 21 +++++++ .idea/inspectionProfiles/Project_Default.xml | 6 ++ .idea/jarRepositories.xml | 40 ++++++++++++ .idea/kotlinc.xml | 6 ++ .idea/misc.xml | 8 +++ .idea/vcs.xml | 6 ++ build.gradle.kts | 13 ++-- .../main/kotlin/org/alter/api/cfg/Items.kt | 3 +- game-plugins/build.gradle.kts | 2 +- .../alkharid/shops/dommik_crafting.plugin.kts | 3 - game-server/build.gradle.kts | 61 +++++++++---------- gradle/libs.versions.toml | 4 +- versions.properties | 2 +- 14 files changed, 133 insertions(+), 48 deletions(-) create mode 100644 .idea/compiler.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/kotlinc.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 000000000..fcb19bf38 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 000000000..59c899515 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..03d9549ea --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 000000000..f14c5e36a --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 000000000..0fc311313 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..f1fea6968 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index bda9e78fe..f10426a61 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,14 +14,14 @@ allprojects { version = "0.0.4" java { toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(18)) vendor.set(JvmVendorSpec.ORACLE) implementation.set(JvmImplementation.VENDOR_SPECIFIC) } } kotlin{ jvmToolchain{ - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(18)) vendor.set(JvmVendorSpec.ORACLE) implementation.set(JvmImplementation.VENDOR_SPECIFIC) } @@ -64,23 +64,20 @@ allprojects { } tasks.compileJava { - sourceCompatibility = JavaVersion.VERSION_17.toString() - targetCompatibility = JavaVersion.VERSION_17.toString() + sourceCompatibility = JavaVersion.VERSION_18.toString() + targetCompatibility = JavaVersion.VERSION_18.toString() } tasks.withType().all { kotlinOptions { languageVersion = "1.9" - jvmTarget = "17" + jvmTarget = "18" freeCompilerArgs = listOf( "-Xallow-any-scripts-in-source-roots" , "-Xjvm-default=all", - "-Xbackend-threads=4", - "-Xignore-const-optimization-errors", ) } } - } tasks.register("packageServer") { diff --git a/game-api/src/main/kotlin/org/alter/api/cfg/Items.kt b/game-api/src/main/kotlin/org/alter/api/cfg/Items.kt index df7d9c73d..42de383de 100644 --- a/game-api/src/main/kotlin/org/alter/api/cfg/Items.kt +++ b/game-api/src/main/kotlin/org/alter/api/cfg/Items.kt @@ -2,8 +2,7 @@ package org.alter.api.cfg object Items { - - const val DWARF_REMAINS = 0 + fun DWARF_REMAINS(): Int { return 0 } const val TOOLKIT = 1 const val CANNONBALL = 2 const val NULODIONS_NOTES = 3 diff --git a/game-plugins/build.gradle.kts b/game-plugins/build.gradle.kts index ef0489ad1..3bbb6e97e 100644 --- a/game-plugins/build.gradle.kts +++ b/game-plugins/build.gradle.kts @@ -1,11 +1,11 @@ description = "Alter Servers Plugins" dependencies { - implementation(projects.gameApi) implementation(projects.gameServer) implementation(projects.util) implementation(projects.net) implementation(kotlin("script-runtime")) + implementation(project(":game-api")) } tasks.named("jar") { diff --git a/game-plugins/src/main/kotlin/org/alter/plugins/content/area/alkharid/shops/dommik_crafting.plugin.kts b/game-plugins/src/main/kotlin/org/alter/plugins/content/area/alkharid/shops/dommik_crafting.plugin.kts index 25326efb5..e738b5ce0 100644 --- a/game-plugins/src/main/kotlin/org/alter/plugins/content/area/alkharid/shops/dommik_crafting.plugin.kts +++ b/game-plugins/src/main/kotlin/org/alter/plugins/content/area/alkharid/shops/dommik_crafting.plugin.kts @@ -1,5 +1,3 @@ -package org.alter.plugins.content.areas.alkharid.shops - import org.alter.plugins.content.mechanics.shops.CoinCurrency create_shop("Dommik's Crafting Store.", CoinCurrency(), purchasePolicy = PurchasePolicy.BUY_STOCK) { @@ -13,5 +11,4 @@ create_shop("Dommik's Crafting Store.", CoinCurrency(), purchasePolicy = Purchas items[7] = ShopItem(Items.TIARA_MOULD, 10) items[8] = ShopItem(Items.BOLT_MOULD, 10) items[9] = ShopItem(Items.BRACELET_MOULD, 5) - } \ No newline at end of file diff --git a/game-server/build.gradle.kts b/game-server/build.gradle.kts index 8c0c3322b..6280cc48b 100644 --- a/game-server/build.gradle.kts +++ b/game-server/build.gradle.kts @@ -34,39 +34,38 @@ sourceSets { tasks.register("install") { description = "Install Alter" - doFirst { - val cacheList = listOf( - "/cache/main_file_cache.dat2", - "/cache/main_file_cache.idx0", - "/cache/main_file_cache.idx1", - "/cache/main_file_cache.idx2", - "/cache/main_file_cache.idx3", - "/cache/main_file_cache.idx4", - "/cache/main_file_cache.idx5", - "/cache/main_file_cache.idx7", - "/cache/main_file_cache.idx8", - "/cache/main_file_cache.idx9", - "/cache/main_file_cache.idx10", - "/cache/main_file_cache.idx11", - "/cache/main_file_cache.idx12", - "/cache/main_file_cache.idx13", - "/cache/main_file_cache.idx14", - "/cache/main_file_cache.idx15", - "/cache/main_file_cache.idx16", - "/cache/main_file_cache.idx17", - "/cache/main_file_cache.idx18", - "/cache/main_file_cache.idx19", - "/cache/main_file_cache.idx20", - "/cache/main_file_cache.idx255", - "xteas.json" - ) - cacheList.forEach { - val file = File("${rootProject.projectDir}/data/$it") - if (!file.exists()) { - throw GradleException("\u001B[45m \u001B[30m Missing file! : $file. Go back to: https://github.com/AlterRSPS/Alter and read how to setup plz >____> It's so easy to set this up and you failed at it wtfff?!?!. \u001B[0m") - } + val cacheList = listOf( + "/cache/main_file_cache.dat2", + "/cache/main_file_cache.idx0", + "/cache/main_file_cache.idx1", + "/cache/main_file_cache.idx2", + "/cache/main_file_cache.idx3", + "/cache/main_file_cache.idx4", + "/cache/main_file_cache.idx5", + "/cache/main_file_cache.idx7", + "/cache/main_file_cache.idx8", + "/cache/main_file_cache.idx9", + "/cache/main_file_cache.idx10", + "/cache/main_file_cache.idx11", + "/cache/main_file_cache.idx12", + "/cache/main_file_cache.idx13", + "/cache/main_file_cache.idx14", + "/cache/main_file_cache.idx15", + "/cache/main_file_cache.idx16", + "/cache/main_file_cache.idx17", + "/cache/main_file_cache.idx18", + "/cache/main_file_cache.idx19", + "/cache/main_file_cache.idx20", + "/cache/main_file_cache.idx255", + "xteas.json" + ) + cacheList.forEach { + val file = File("${rootProject.projectDir}/data/$it") + if (!file.exists()) { + throw GradleException("\u001B[45m \u001B[30m Missing file! : $file. Go back to: https://github.com/AlterRSPS/Alter and read how to setup plz >____> It's so easy to set this up and you failed at it wtfff?!?!. \u001B[0m") } } + doLast { copy { into("${rootProject.projectDir}/") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 39894053f..7245d2e41 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,7 +17,7 @@ nettyAll = "_" kotlinxSerializationCore = "_" junit = "4.+" kotlinTestJunit = "_" -kotlin = "1.9.0-Beta" +kotlin = "1.8.10" [libraries] fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" } @@ -37,7 +37,7 @@ jbcrypt = { group = "org.mindrot", name = "jbcrypt", version.ref = "jbcrypt" } gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } cache = { group = "net.runelite", name = "cache", version.ref = "cache" } netty-all = { group = "io.netty", name = "netty-all", version = "5.0.0.Alpha1" } -kotlin-scripting = {group = "org.jetbrains.kotlin", name = "kotlin-scripting-common", version.ref = "kotlin"} +kotlin-scripting = {group = "org.jetbrains.kotlin", name = "kotlin-scripting-common", version = "_"} kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin"} kotlinx-coroutines = {group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "_"} kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "kotlinxSerializationCore" } diff --git a/versions.properties b/versions.properties index 78d8594bb..337950b73 100644 --- a/versions.properties +++ b/versions.properties @@ -15,7 +15,7 @@ version.io.netty..netty-all=4.1.93.Final ## # available=5.0.0.Alpha1 ## # available=5.0.0.Alpha2 -version.kotlin=1.8.20 +version.kotlin=1.8.10 ## # available=1.9.0-Beta version.kotlinx.coroutines=1.7.1