|
| 1 | +import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
| 2 | + |
| 3 | +plugins { |
| 4 | + kotlin("jvm") version "2.1.10" |
| 5 | + id("com.gradleup.shadow") version "8.3.5" |
| 6 | + id("net.minecrell.plugin-yml.bukkit") version "0.6.0" |
| 7 | + id("xyz.jpenilla.run-paper") version "2.3.1" |
| 8 | +} |
| 9 | + |
| 10 | +repositories { |
| 11 | + mavenLocal() |
| 12 | + mavenCentral() |
| 13 | + maven("https://s01.oss.sonatype.org/content/groups/public/") |
| 14 | + maven("https://repo.papermc.io/repository/maven-public/") |
| 15 | + maven("https://repo.alessiodp.com/releases/") |
| 16 | + maven("https://jitpack.io") |
| 17 | +} |
| 18 | + |
| 19 | +dependencies { |
| 20 | + fun compileOnlyAndTestImpl(dependencyNotation: Any) { |
| 21 | + compileOnly(dependencyNotation) |
| 22 | + testImplementation(dependencyNotation) |
| 23 | + } |
| 24 | + |
| 25 | + compileOnly(kotlin("stdlib")) // loaded through library loader |
| 26 | + compileOnly(kotlin("reflect")) // loaded through library loader |
| 27 | + compileOnlyAndTestImpl("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT") |
| 28 | + compileOnlyAndTestImpl("com.github.Slimefun:Slimefun4:3ea21da4fe") |
| 29 | + compileOnly("net.guizhanss:SlimefunTranslation:e03b01a7b7") |
| 30 | + compileOnly("com.github.schntgaispock:SlimeHUD:1.3.0") |
| 31 | + compileOnly("com.github.SlimefunGuguProject:InfinityExpansion:bebf0bd0f9") |
| 32 | + compileOnly("com.github.VoperAD:SlimeFrame:8af2379a01") |
| 33 | + implementation("org.bstats:bstats-bukkit:3.1.0") |
| 34 | + implementation("net.guizhanss:guizhanlib-all:2.3.0-SNAPSHOT") |
| 35 | + implementation("net.guizhanss:guizhanlib-kt-all:0.1.0-SNAPSHOT") |
| 36 | + |
| 37 | + testImplementation(kotlin("test")) |
| 38 | + testImplementation("org.mockbukkit.mockbukkit:mockbukkit-v1.21:4.10.0") |
| 39 | +} |
| 40 | + |
| 41 | +group = "net.guizhanss" |
| 42 | +description = "FastMachines" |
| 43 | + |
| 44 | +val mainPackage = "net.guizhanss.fastmachines" |
| 45 | + |
| 46 | +java { |
| 47 | + disableAutoTargetJvm() |
| 48 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 49 | + targetCompatibility = JavaVersion.VERSION_17 |
| 50 | +} |
| 51 | + |
| 52 | +kotlin { |
| 53 | + compilerOptions { |
| 54 | + javaParameters = true |
| 55 | + jvmTarget = JvmTarget.JVM_17 |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +tasks.shadowJar { |
| 60 | + fun doRelocate(from: String, to: String? = null) { |
| 61 | + val last = to ?: from.split(".").last() |
| 62 | + relocate(from, "$mainPackage.libs.$last") |
| 63 | + } |
| 64 | + |
| 65 | + doRelocate("net.byteflux.libby") |
| 66 | + doRelocate("net.guizhanss.guizhanlib") |
| 67 | + doRelocate("org.bstats") |
| 68 | + doRelocate("io.papermc.lib", "paperlib") |
| 69 | + minimize() |
| 70 | + archiveClassifier = "" |
| 71 | +} |
| 72 | + |
| 73 | +bukkit { |
| 74 | + main = "$mainPackage.FastMachines" |
| 75 | + apiVersion = "1.18" |
| 76 | + authors = listOf("ybw0014") |
| 77 | + description = "More Slimefun machines that bulk craft items with all shapeless recipes" |
| 78 | + depend = listOf("Slimefun") |
| 79 | + softDepend = listOf( |
| 80 | + "GuizhanLibPlugin", |
| 81 | + "SlimefunTranslation", |
| 82 | + "InfinityExpansion", |
| 83 | + "SlimeFrame", |
| 84 | + "SlimeHUD", |
| 85 | + "InfinityExpansion2", |
| 86 | + ) |
| 87 | + loadBefore = listOf( |
| 88 | + "SlimeCustomizer", |
| 89 | + "RykenSlimeCustomizer", |
| 90 | + "SlimeFunRecipe" |
| 91 | + ) |
| 92 | +} |
| 93 | + |
| 94 | +tasks.runServer { |
| 95 | + downloadPlugins { |
| 96 | + // Slimefun |
| 97 | + url("https://blob.build/dl/Slimefun4/Dev/latest") |
| 98 | + // SlimeHUD |
| 99 | + url("https://blob.build/dl/SlimeHUD/Dev/latest") |
| 100 | + // GuizhanCraft for testing convenient |
| 101 | + url("https://builds.guizhanss.com/api/download/ybw0014/GuizhanCraft/master/latest") |
| 102 | + } |
| 103 | + jvmArgs("-Dcom.mojang.eula.agree=true") |
| 104 | + minecraftVersion("1.20.6") |
| 105 | +} |
| 106 | + |
| 107 | +tasks.test { |
| 108 | + useJUnitPlatform() |
| 109 | +} |
0 commit comments