build.gradle.kts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
  2. buildscript {
  3. repositories {
  4. jcenter()
  5. }
  6. }
  7. // Extras
  8. var core by extra { project("core") }
  9. // Bukkit/Spigot plugins
  10. val bukkit by extra { project("bukkit") }
  11. val bukkit_18 by extra { bukkit.project("1_8_8") }
  12. val bukkit_112 by extra { bukkit.project("1_12") }
  13. val bukkit_113 by extra { bukkit.project("1_13") }
  14. // Sponge plugins
  15. val sponge by extra { project("sponge") }
  16. val sponge_7 by extra { sponge.project("api7") }
  17. group = properties["pluginGroup"]!!
  18. version = properties["pluginVersion"]!!
  19. plugins {
  20. `java-library`
  21. java
  22. id("com.github.johnrengelman.shadow") version "4.0.4"
  23. }
  24. // Set up defaults for all projects, maven repositories, java compatibility level and compiling encoding
  25. allprojects {
  26. apply(plugin="java-library")
  27. apply(plugin="com.github.johnrengelman.shadow")
  28. repositories {
  29. mavenCentral()
  30. // World Edit
  31. maven("https://maven.sk89q.com/repo")
  32. // bStats
  33. maven("https://repo.codemc.org/repository/maven-public")
  34. }
  35. dependencies {
  36. compile("org.apache.tomcat", "tomcat-jdbc", "7.0.52") // tomcat JDBC
  37. compile("org.apache.tomcat", "tomcat-juli", "7.0.52") // tomcat juli
  38. testCompile("junit", "junit", "4.12")
  39. }
  40. java {
  41. sourceCompatibility = JavaVersion.VERSION_1_8
  42. targetCompatibility = JavaVersion.VERSION_1_8
  43. }
  44. tasks.getting(JavaCompile::class) {
  45. options.encoding = "UTF-8"
  46. }
  47. }
  48. val jar by tasks.getting(Jar::class) {
  49. manifest {
  50. attributes(mapOf(
  51. "Implementation-Title" to "mcMMO",
  52. "Implementation-Version" to rootProject.properties["pluginVersion"]!!,
  53. "Main-Class" to "com.gmail.nossr50.mcMMO" // Main plugin class for bukkit
  54. ))
  55. }
  56. }
  57. val shadowJar by tasks.getting(ShadowJar::class) {
  58. dependencies {
  59. include(project("core"))
  60. include(dependency("org.bstats:bstats-bukkit:1.4"))
  61. }
  62. relocate("org.bstats", "com.gmail.nossr50.metrics.bstat")
  63. }