build.gradle 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. modImplementation "io.github.prospector:modmenu:${modmenu_version}"
  59. compile "org.lwjgl:lwjgl-jemalloc:3.2.1"
  60. compileOnly "com.google.code.findbugs:jsr305:3.0.2"
  61. implementation 'org.jetbrains:annotations:15.0'
  62. modRuntime ("com.lettuce.fudge:notenoughcrashes:1.0.12+1.15") {
  63. transitive = false
  64. }
  65. }
  66. task sourcesJar(type: Jar, dependsOn: classes) {
  67. classifier = "sources"
  68. from sourceSets.main.allSource
  69. }
  70. task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) {
  71. // classifier = "maven"
  72. afterEvaluate {
  73. input = file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
  74. archiveName = "${archivesBaseName}-${version}-maven.jar"
  75. addNestedDependencies = false
  76. }
  77. }
  78. publishing {
  79. publications {
  80. mavenJava(MavenPublication) {
  81. artifact(file("${project.buildDir}/libs/$archivesBaseName-${version}.jar")) {
  82. builtBy remapJar
  83. }
  84. artifact(sourcesJar) {
  85. builtBy remapSourcesJar
  86. }
  87. }
  88. }
  89. repositories {
  90. if (project.hasProperty('danielshe_pass')) {
  91. maven {
  92. url = "http://deploy.modmuss50.me/"
  93. credentials {
  94. username = "danielshe"
  95. password = project.getProperty('danielshe_pass')
  96. }
  97. }
  98. }
  99. }
  100. }