From ed08f9f3bd6726da20a46ef637c1e80993197a32 Mon Sep 17 00:00:00 2001 From: jnngl Date: Wed, 24 Jul 2024 20:26:09 +1100 Subject: [PATCH] Kotlin DSL --- build.gradle | 68 --------------------------------------------- build.gradle.kts | 60 +++++++++++++++++++++++++++++++++++++++ settings.gradle | 1 - settings.gradle.kts | 1 + 4 files changed, 61 insertions(+), 69 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 3f4cfcc..0000000 --- a/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -plugins { - id("java") - id("io.papermc.paperweight.userdev").version("1.7.1") - id("xyz.jpenilla.run-paper").version("2.3.0") - id("io.github.goooler.shadow").version("8.1.7") -} - -setGroup("com.jnngl") -setVersion("1.0.1") - -repositories { - mavenCentral() - maven { - setName("papermc-repo") - setUrl("https://repo.papermc.io/repository/maven-public/") - } - maven { - setName("sonatype") - setUrl("https://oss.sonatype.org/content/groups/public/") - } -} - -dependencies { - paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.21-R0.1-SNAPSHOT") - implementation("net.elytrium:serializer:1.1.1") - implementation("com.jnngl:mapcolor:1.0.1") - compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") - annotationProcessor("org.projectlombok:lombok:1.18.30") - compileOnly("org.projectlombok:lombok:1.18.30") - implementation("com.j256.ormlite:ormlite-jdbc:6.1") - implementation("org.xerial:sqlite-jdbc:3.45.0.0") - implementation("org.bstats:bstats-bukkit:3.0.2") -} - -shadowJar { - relocate("net.elytrium.serializer", "com.jnngl.vanillaminimaps.serializer") - relocate("org.bstats", "com.jnngl.vanillaminimaps.metrics") - exclude("org/slf4j/**") - minimize() -} - -def targetJavaVersion = 21 -java { - def javaVersion = JavaVersion.toVersion(targetJavaVersion) - setSourceCompatibility(javaVersion) - setTargetCompatibility(javaVersion) - if (JavaVersion.current() < javaVersion) { - getToolchain().setLanguageVersion(JavaLanguageVersion.of(targetJavaVersion)) - } -} - -tasks.withType(JavaCompile).configureEach({ - if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - getOptions().getRelease().set(targetJavaVersion) - } -}) - -processResources { - def props = [version: version] - getInputs().properties(props) - filteringCharset("UTF-8") - filesMatching("plugin.yml") { - expand(props) - } -} - -reobfJar.dependsOn(shadowJar) -assemble.dependsOn(reobfJar) \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..3dc718a --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,60 @@ +plugins { + java + id("io.papermc.paperweight.userdev").version("1.7.1") + id("xyz.jpenilla.run-paper").version("2.3.0") + id("io.github.goooler.shadow").version("8.1.7") +} + +group = "com.jnngl" +version = "1.0.1" + +repositories { + mavenCentral() + maven { + name = "papermc-repo" + url = uri("https://repo.papermc.io/repository/maven-public/") + } + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/content/groups/public/") + } +} + +dependencies { + paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.21-R0.1-SNAPSHOT") + implementation("net.elytrium:serializer:1.1.1") + implementation("com.jnngl:mapcolor:1.0.1") + compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") + annotationProcessor("org.projectlombok:lombok:1.18.30") + compileOnly("org.projectlombok:lombok:1.18.30") + implementation("com.j256.ormlite:ormlite-jdbc:6.1") + implementation("org.xerial:sqlite-jdbc:3.45.0.0") + implementation("org.bstats:bstats-bukkit:3.0.2") +} + +java { + val version = JavaLanguageVersion.of(21) + toolchain.languageVersion.set(version) +} + +tasks { + shadowJar { + relocate("net.elytrium.serializer", "com.jnngl.vanillaminimaps.serializer") + relocate("org.bstats", "com.jnngl.vanillaminimaps.metrics") + exclude("org/slf4j/**") + minimize() + } + + processResources { + val props = mapOf("version" to version) + inputs.properties(props) + filteringCharset = "UTF-8" + filesMatching("plugin.yml") { + expand(props) + } + } + + reobfJar { + dependsOn(shadowJar) + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 430f3f9..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'vanillaminimaps' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..934dd2b --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "vanillaminimaps"