build.gradle 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import java.text.SimpleDateFormat
  2. plugins {
  3. id 'fabric-loom' version '0.2.5-SNAPSHOT'
  4. id 'maven-publish'
  5. id 'net.minecrell.licenser' version '0.4.1'
  6. }
  7. sourceCompatibility = 1.8
  8. targetCompatibility = 1.8
  9. archivesBaseName = "RoughlyEnoughItems"
  10. group = "me.shedaniel"
  11. def ENV = System.getenv()
  12. version = (((String) project.mod_version).contains("unstable") ? (project.mod_version + "." + buildTime()) : project.mod_version + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER) : "local"))
  13. def includeDep = true
  14. minecraft {
  15. }
  16. static def buildTime() {
  17. def df = new SimpleDateFormat("yyyyMMddHHmm")
  18. df.setTimeZone(TimeZone.getTimeZone("UTC"))
  19. return df.format(new Date())
  20. }
  21. license {
  22. header rootProject.file('HEADER')
  23. include '**/*.java'
  24. exclude '**/Scissors.java'
  25. }
  26. repositories {
  27. maven { url "https://tehnut.info/maven/" }
  28. maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
  29. maven { url "https://minecraft.curseforge.com/api/maven" }
  30. }
  31. processResources {
  32. filesMatching('fabric.mod.json') {
  33. expand 'version': project.version
  34. }
  35. inputs.property "version", project.version
  36. }
  37. dependencies {
  38. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  39. mappings "net.fabricmc:yarn:${project.yarn_version}"
  40. modApi "net.fabricmc:fabric-loader:${project.fabricloader_version}"
  41. modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_api}"
  42. modApi("me.shedaniel.cloth:cloth-events:${cloth_events_version}") {
  43. transitive = false
  44. }
  45. modImplementation("me.shedaniel.cloth:config-2:${cloth_config_version}") {
  46. transitive = false
  47. }
  48. modApi("me.shedaniel.cloth:fiber2cloth:1.2.0") {
  49. transitive = false
  50. }
  51. modApi "me.zeroeightsix:fiber:0.6.0-7"
  52. modApi "blue.endless:jankson:${project.jankson_version}"
  53. if (includeDep) {
  54. include("me.shedaniel.cloth:cloth-events:${cloth_events_version}") {
  55. transitive = false
  56. }
  57. include("me.shedaniel.cloth:config-2:${cloth_config_version}") {
  58. transitive = false
  59. }
  60. include("me.shedaniel.cloth:fiber2cloth:1.2.0") {
  61. transitive = false
  62. }
  63. include "me.zeroeightsix:fiber:0.6.0-7"
  64. }
  65. modImplementation "io.github.prospector:modmenu:${modmenu_version}"
  66. compile "org.lwjgl:lwjgl-jemalloc:3.2.1"
  67. compileOnly "com.google.code.findbugs:jsr305:3.0.2"
  68. implementation 'org.jetbrains:annotations:15.0'
  69. }
  70. task sourcesJar(type: Jar, dependsOn: classes) {
  71. classifier = "sources"
  72. from sourceSets.main.allSource
  73. }
  74. publishing {
  75. publications {
  76. mavenJava(MavenPublication) {
  77. artifact(remapJar) {
  78. builtBy remapJar
  79. }
  80. artifact(sourcesJar) {
  81. builtBy remapSourcesJar
  82. }
  83. }
  84. }
  85. repositories {
  86. if (project.hasProperty('danielshe_pass')) {
  87. maven {
  88. url = "http://deploy.modmuss50.me/"
  89. credentials {
  90. username = "danielshe"
  91. password = project.getProperty('danielshe_pass')
  92. }
  93. }
  94. }
  95. }
  96. }