|
| 1 | +plugins { |
| 2 | + `java-library` |
| 3 | + id("re.alwyn974.groupez.repository") version "1.0.0" |
| 4 | + id("re.alwyn974.groupez.publish") version "1.0.0" |
| 5 | + id("com.gradleup.shadow") version "9.0.0-beta11" |
| 6 | +} |
| 7 | + |
| 8 | +rootProject.extra.properties["sha"]?.let { sha -> |
| 9 | + version = sha |
| 10 | +} |
| 11 | + |
| 12 | +group = "fr.traqueur.currencies" |
| 13 | +version = property("version") as String |
| 14 | + |
| 15 | +extra.set("targetFolder", file("target/")) |
| 16 | +extra.set("classifier", System.getProperty("archive.classifier")) |
| 17 | +extra.set("sha", System.getProperty("github.sha")) |
| 18 | + |
| 19 | +repositories { |
| 20 | + mavenCentral() |
| 21 | + maven { |
| 22 | + url = uri("https://jitpack.io") |
| 23 | + name = "jitpack" |
| 24 | + } |
| 25 | + maven { |
| 26 | + url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") |
| 27 | + name = "spigot-repo" |
| 28 | + } |
| 29 | + maven { |
| 30 | + url = uri("https://nexus.bencodez.com/repository/maven-public/") |
| 31 | + name = "BenCodez Repo" |
| 32 | + } |
| 33 | +} |
| 34 | + |
| 35 | +dependencies { |
| 36 | + compileOnly("org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT") |
| 37 | + |
| 38 | + compileOnly("com.github.MilkBowl:VaultAPI:1.7") |
| 39 | + compileOnly("com.github.PlayerNguyen:OptEco:2.1.4b") |
| 40 | + compileOnly("com.willfp:EcoBits:1.8.4") |
| 41 | + compileOnly("com.bencodez:votingplugin:6.17.2") |
| 42 | + compileOnly("com.github.Emibergo02:RedisEconomy:4.3.19") |
| 43 | + |
| 44 | + compileOnly("fr.maxlego08.menu:zmenu-api:1.1.0.0") |
| 45 | + |
| 46 | + compileOnly(files("libs/bt-api-3.14.6.jar")) |
| 47 | + compileOnly(files("libs/MySQLTokens.jar")) |
| 48 | + compileOnly(files("libs/PlayerPoints-3.2.7.jar")) |
| 49 | + compileOnly(files("libs/TokenAPI.jar")) |
| 50 | + compileOnly(files("libs/GemAPI.jar")) |
| 51 | + compileOnly(files("libs/zEssentialsAPI-1.0.1.4.jar")) |
| 52 | + compileOnly(files("libs/CoinsEngine-2.4.2.jar")) |
| 53 | + compileOnly(files("libs/nightcore-2.7.1.jar")) |
| 54 | + compileOnly(files("libs/RoyaleEconomyAPI.jar")) |
| 55 | +} |
| 56 | + |
| 57 | +val targetJavaVersion = 8 |
| 58 | + |
| 59 | +java { |
| 60 | + val javaVersion = JavaVersion.toVersion(targetJavaVersion) |
| 61 | + sourceCompatibility = javaVersion |
| 62 | + targetCompatibility = javaVersion |
| 63 | + if (JavaVersion.current() < javaVersion) { |
| 64 | + toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion)) |
| 65 | + } |
| 66 | + |
| 67 | + withSourcesJar() |
| 68 | + withJavadocJar() |
| 69 | +} |
| 70 | + |
| 71 | +tasks.withType<JavaCompile>().configureEach { |
| 72 | + options.encoding = "UTF-8" |
| 73 | + if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible) { |
| 74 | + options.release.set(targetJavaVersion) |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +val generateVersionProperties by tasks.registering { |
| 79 | + doLast { |
| 80 | + val file = file("src/main/resources/${project.name.lowercase()}.properties") |
| 81 | + file.parentFile.mkdirs() |
| 82 | + file.writeText("version=${project.version}") |
| 83 | + } |
| 84 | +} |
| 85 | + |
| 86 | +tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> { |
| 87 | + archiveClassifier.set("") // Écrase le JAR de base par le fat jar |
| 88 | +} |
| 89 | + |
| 90 | +tasks.build { |
| 91 | + dependsOn(tasks.shadowJar) |
| 92 | +} |
| 93 | + |
| 94 | +tasks.withType<Jar> { |
| 95 | + manifest { |
| 96 | + attributes["Implementation-Title"] = "CurrenciesAPI" |
| 97 | + attributes["Implementation-Version"] = project.version |
| 98 | + } |
| 99 | +} |
| 100 | + |
| 101 | +publishConfig { |
| 102 | + githubOwner = "GroupeZ-dev" |
| 103 | + useRootProjectName = true |
| 104 | +} |
0 commit comments