Created
July 4, 2021 11:33
-
-
Save kraftwerk28/dfd51cdcb39842f9c061aff4f282b867 to your computer and use it in GitHub Desktop.
spigot-tg-bridge build.gradle.kts
This file contains hidden or 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
import org.yaml.snakeyaml.Yaml | |
import java.io.* | |
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | |
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
buildscript { | |
repositories { | |
mavenCentral() | |
maven("https://plugins.gradle.org/m2/") | |
} | |
dependencies { | |
classpath("org.yaml:snakeyaml:1.26") | |
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.1.0") | |
} | |
} | |
plugins { | |
java | |
application | |
id("org.jetbrains.kotlin.jvm") version "1.4.31" | |
id("com.github.johnrengelman.shadow") version "5.2.0" | |
id("com.github.gradle-lean") version "0.1.2" | |
} | |
apply(plugin = "org.jlleitschuh.gradle.ktlint") | |
group = "org.kraftwerk28" | |
val cfg: Map<String, String> = Yaml() | |
.load(FileInputStream("$projectDir/src/main/resources/plugin.yml")) | |
val pluginVersion = cfg.get("version") | |
val spigotApiVersion = cfg.get("api-version") | |
val exposedVersion = "0.31.1" | |
version = pluginVersion as Any | |
repositories { | |
mavenCentral() | |
maven( | |
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" | |
) | |
maven(url = "https://jitpack.io") | |
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") | |
} | |
val tgBotVersion = "6.0.4" | |
val retrofitVersion = "2.7.1" | |
val plugDir = "MinecraftServers/spigot_1.17/plugins/" | |
val homeDir = System.getProperty("user.home") | |
dependencies { | |
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | |
compileOnly("org.spigotmc:spigot-api:$spigotApiVersion-R0.1-SNAPSHOT") | |
implementation("com.google.code.gson:gson:2.8.7") | |
implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") | |
implementation("com.squareup.retrofit2:converter-gson:$retrofitVersion") | |
implementation("com.squareup.okhttp3:logging-interceptor:4.2.1") | |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0") | |
implementation("com.vdurmont:emoji-java:5.1.1") | |
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion") | |
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion") | |
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion") | |
} | |
defaultTasks("shadowJar") | |
tasks { | |
// named<ShadowJar>("shadowJar") { | |
// archiveFileName.set( | |
// "spigot-tg-bridge-${spigotApiVersion}-v${pluginVersion}.jar" | |
// ) | |
// } | |
register<Copy>("copyArtifacts") { | |
from("shadowJar") | |
into(File(homeDir, plugDir)) | |
} | |
register("pack") { | |
description = "[For development only!] Build project and copy .jar into servers directory" | |
dependsOn("shadowJar") | |
finalizedBy("copyArtifacts") | |
} | |
} | |
leanConfig { | |
excludedClasses = listOf<String>() | |
excludedDependencies = listOf<String>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment