build.gradle 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. plugins {
  2. id 'fabric-loom' version '0.2.6-SNAPSHOT'
  3. id 'maven-publish'
  4. id 'net.minecrell.licenser' version '0.4.1'
  5. }
  6. sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
  7. archivesBaseName = project.archives_base_name
  8. version = (project.mod_version as String).contains("unstable") ? (project.mod_version + "." + buildTime()) : project.mod_version
  9. group = project.maven_group
  10. static def buildTime() {
  11. def df = new java.text.SimpleDateFormat("yyyyMMddHHmm")
  12. df.setTimeZone(TimeZone.getTimeZone("UTC"))
  13. return df.format(new Date())
  14. }
  15. license {
  16. header rootProject.file('HEADER')
  17. include '**/*.java'
  18. }
  19. minecraft {
  20. }
  21. dependencies {
  22. //to change the versions see the gradle.properties file
  23. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  24. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  25. modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
  26. // Fabric API. This is technically optional, but you probably want it anyway.
  27. modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  28. // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
  29. // You may need to force-disable transitiveness on them.
  30. modCompileOnly ("io.github.prospector:modmenu:${project.modmenu_version}") {
  31. transitive = false
  32. }
  33. modRuntime ("io.github.prospector:modmenu:${project.modmenu_version}") {
  34. transitive = false
  35. }
  36. modCompileOnly ("me.shedaniel:RoughlyEnoughItems:${project.roughlyenoughitems}")
  37. modRuntime ("me.shedaniel:RoughlyEnoughItems:${project.roughlyenoughitems}")
  38. modRuntime ("me.shedaniel.cloth:config-2:2.9.3") {
  39. force(true)
  40. }
  41. compileOnly "com.google.code.findbugs:jsr305:3.0.2"
  42. compileOnly 'org.jetbrains:annotations:15.0'
  43. modRuntime("com.lettuce.fudge:notenoughcrashes:${project.notenoughcrashes_version}") {
  44. transitive = false
  45. }
  46. }
  47. processResources {
  48. inputs.property "version", project.version
  49. from(sourceSets.main.resources.srcDirs) {
  50. include "fabric.mod.json"
  51. expand "version": project.version
  52. }
  53. from(sourceSets.main.resources.srcDirs) {
  54. exclude "fabric.mod.json"
  55. }
  56. }
  57. tasks.withType(JavaCompile) {
  58. options.encoding = "UTF-8"
  59. }
  60. task sourcesJar(type: Jar, dependsOn: classes) {
  61. classifier = "sources"
  62. from sourceSets.main.allSource
  63. }
  64. jar {
  65. from "LICENSE"
  66. }
  67. // configure the maven publication
  68. publishing {
  69. publications {
  70. mavenJava(MavenPublication) {
  71. // add all the jars that should be included when publishing to maven
  72. artifact(remapJar) {
  73. builtBy remapJar
  74. }
  75. artifact(sourcesJar) {
  76. builtBy remapSourcesJar
  77. }
  78. }
  79. }
  80. // select the repositories you want to publish to
  81. repositories {
  82. // uncomment to publish to the local maven
  83. // mavenLocal()
  84. }
  85. }