build.gradle 3.5 KB

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