-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to Kotlin version 1.8.20 and migrated to Kotlin DSL
- Loading branch information
1 parent
7b9c88a
commit 9a2b304
Showing
6 changed files
with
95 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName | ||
import java.net.URI | ||
|
||
plugins { | ||
val kotlinPluginVersion = "1.8.20" | ||
val shadowVersion = "7.0.0" | ||
|
||
kotlin("jvm") version kotlinPluginVersion | ||
id("com.github.johnrengelman.shadow") version shadowVersion | ||
} | ||
|
||
group = "de.felix0351" | ||
version = "1.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = "spigotmc-repo" | ||
url = URI("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT") | ||
val kotlin_version = "1.8.20" | ||
val ktor_version = "2.3.4" | ||
val exposed_version = "0.44.0" | ||
val coroutines_version = "1.7.3" | ||
val sqlite_version = "3.43.0.0" | ||
val mariadb_version = "3.2.0" | ||
|
||
//Kotlin standard library | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") | ||
//Kotlin Exposed SQL library | ||
implementation("org.jetbrains.exposed:exposed-core:$exposed_version") | ||
implementation("org.jetbrains.exposed:exposed-dao:$exposed_version") | ||
implementation("org.jetbrains.exposed:exposed-jdbc:$exposed_version") | ||
//Kotlin Coroutines Core for JVM | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") | ||
//Kotlin Ktor library for network communication | ||
implementation("io.ktor:ktor-client-core:$ktor_version") | ||
implementation("io.ktor:ktor-client-cio:$ktor_version") | ||
implementation("io.ktor:ktor-client-java:$ktor_version") | ||
implementation("io.ktor:ktor-client-content-negotiation:$ktor_version") | ||
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version") | ||
|
||
//SQLite Driver | ||
implementation("org.xerial:sqlite-jdbc:$sqlite_version") | ||
//MariaDB Driver | ||
implementation("org.mariadb.jdbc:mariadb-java-client:$mariadb_version") | ||
|
||
} | ||
|
||
tasks.withType<PublishToMavenRepository> { | ||
dependsOn(tasks.shadowJar) | ||
} | ||
|
||
java { | ||
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
|
||
shadow { | ||
archivesName.set("KotlinBukkitLib") | ||
version = "1.8.20" // Set the version to the current kotlin version | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = "KotlinBukkitLib" |
21 changes: 20 additions & 1 deletion
21
src/main/java/de/felix0351/kotlinbukkitlib/KotlinBukkitLib.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
package de.felix0351.kotlinbukkitlib | ||
|
||
import org.bukkit.ChatColor | ||
import org.bukkit.command.Command | ||
import org.bukkit.command.CommandExecutor | ||
import org.bukkit.command.CommandSender | ||
import org.bukkit.plugin.java.JavaPlugin | ||
|
||
class KotlinBukkitLib : JavaPlugin() | ||
class KotlinBukkitLib : JavaPlugin(), CommandExecutor { | ||
|
||
override fun onEnable() { | ||
getCommand("kotlinbukkitlib")?.setExecutor(this) | ||
server.consoleSender.sendMessage(ChatColor.LIGHT_PURPLE.toString() + "Keep Calm and Love Kotlin!") | ||
super.onEnable() | ||
} | ||
|
||
|
||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>?): Boolean { | ||
sender.sendMessage("§dKeep Calm and Love Kotlin!") | ||
return true | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
name: KotlinBukkitLib | ||
version: '${version}' | ||
version: 1.8.20 | ||
main: de.felix0351.kotlinbukkitlib.KotlinBukkitLib | ||
api-version: 1.15 | ||
load: STARTUP | ||
authors: [ felix0351 ] | ||
description: KotlinBukkitLib is a Bukkit-Plugin which load the Kotlin libraries for your mod. | ||
description: KotlinBukkitLib is a Bukkit-Plugin which loads the standard kotlin libraries for your plugins with ktor, kotlinx.coroutines, kotlinx.serialization as well as the sqlite and the mariadb driver. | ||
website: https://github.com/felix0351z | ||
|
||
|
||
commands: | ||
kotlinbukkitlib: | ||
description: Show your love for Kotlin! | ||
usage: /kotlinbukkitlib |