build.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import groovy.json.JsonSlurper
  2. plugins {
  3. id 'fabric-loom' version '0.5-SNAPSHOT' apply false
  4. }
  5. subprojects {
  6. apply plugin: "fabric-loom"
  7. sourceCompatibility = JavaVersion.VERSION_1_8
  8. targetCompatibility = JavaVersion.VERSION_1_8
  9. group = rootProject.maven_group
  10. archivesBaseName = "${rootProject.archives_base_name}-${project.name}"
  11. version = rootProject.mod_version
  12. ext.modName = new JsonSlurper().parse(file("src/main/resources/fabric.mod.json")).name
  13. processResources {
  14. inputs.property "version", project.version
  15. filesMatching("fabric.mod.json") {
  16. expand "version": project.version
  17. }
  18. }
  19. tasks.withType(JavaCompile).configureEach {
  20. // ensure that the encoding is set to UTF-8, no matter what the system default is
  21. // this fixes some edge cases with special characters not displaying correctly
  22. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  23. it.options.encoding = "UTF-8"
  24. }
  25. repositories {
  26. maven {
  27. url "https://maven.shedaniel.me/"
  28. }
  29. maven {
  30. url "https://maven.terraformersmc.com/"
  31. }
  32. }
  33. dependencies {
  34. minecraft("com.mojang:minecraft:${rootProject.minecraft_version}")
  35. mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2")
  36. modImplementation("net.fabricmc:fabric-loader:${rootProject.loader_version}")
  37. modApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_version}") {
  38. exclude(group: "net.fabricmc.fabric-api")
  39. }
  40. modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}")
  41. // Using modApi because api does not include dependency inside Maven pom file
  42. // see https://github.com/FabricMC/fabric-loom/issues/200
  43. modApi("org.spongepowered:configurate-hocon:${rootProject.configurate_version}")
  44. compileOnly("org.projectlombok:lombok:${rootProject.lombok_version}")
  45. annotationProcessor("org.projectlombok:lombok:${rootProject.lombok_version}")
  46. }
  47. }