build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. plugins {
  2. id 'fabric-loom' version '0.5-SNAPSHOT'
  3. id 'maven-publish'
  4. }
  5. sourceCompatibility = JavaVersion.VERSION_1_8
  6. targetCompatibility = JavaVersion.VERSION_1_8
  7. archivesBaseName = project.archives_base_name
  8. version = project.mod_version
  9. group = project.maven_group
  10. repositories {
  11. maven {
  12. url 'https://jitpack.io'
  13. }
  14. }
  15. dependencies {
  16. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  17. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  18. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  19. //Fabric API is only required for Cloth Config (required for CompleteConfig) which includes old version (1.16) and crashes
  20. //TODO: Update CompleteConfig and remove Fabric API dependency
  21. modImplementation "net.fabricmc.fabric-api:fabric-api:0.21.0+build.407-1.16"
  22. modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
  23. modApi "com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}"
  24. include "com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}"
  25. include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
  26. compileOnly "org.projectlombok:lombok:${project.lombok_version}"
  27. annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
  28. }
  29. processResources {
  30. inputs.property "version", project.version
  31. filesMatching("fabric.mod.json") {
  32. expand "version": project.version
  33. }
  34. }
  35. tasks.withType(JavaCompile).configureEach {
  36. // ensure that the encoding is set to UTF-8, no matter what the system default is
  37. // this fixes some edge cases with special characters not displaying correctly
  38. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  39. it.options.encoding = "UTF-8"
  40. }
  41. java {
  42. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  43. // if it is present.
  44. withSourcesJar()
  45. }
  46. jar {
  47. from("LICENSE") {
  48. rename { "${it}_${project.archivesBaseName}"}
  49. }
  50. }
  51. // configure the maven publication
  52. publishing {
  53. publications {
  54. mavenJava(MavenPublication) {
  55. artifact(remapJar) {
  56. builtBy remapJar
  57. }
  58. artifact(sourcesJar) {
  59. builtBy remapSourcesJar
  60. }
  61. }
  62. }
  63. }