build.gradle 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. //to change the versions see the gradle.properties file
  17. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  18. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  19. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  20. //Fabric API is only required for Cloth Config (required for CompleteConfig) which includes old version (1.16) and crashes
  21. //TODO: Update CompleteConfig and remove Fabric API dependency
  22. modImplementation "net.fabricmc.fabric-api:fabric-api:0.21.0+build.407-1.16"
  23. modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
  24. modApi "com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}"
  25. include "com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}"
  26. include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
  27. compileOnly "org.projectlombok:lombok:${project.lombok_version}"
  28. annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
  29. }
  30. processResources {
  31. inputs.property "version", project.version
  32. filesMatching("fabric.mod.json") {
  33. expand "version": project.version
  34. }
  35. }
  36. tasks.withType(JavaCompile).configureEach {
  37. // ensure that the encoding is set to UTF-8, no matter what the system default is
  38. // this fixes some edge cases with special characters not displaying correctly
  39. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  40. it.options.encoding = "UTF-8"
  41. }
  42. java {
  43. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  44. // if it is present.
  45. // If you remove this line, sources will not be generated.
  46. withSourcesJar()
  47. }
  48. jar {
  49. from("LICENSE") {
  50. rename { "${it}_${project.archivesBaseName}"}
  51. }
  52. }
  53. // configure the maven publication
  54. publishing {
  55. publications {
  56. mavenJava(MavenPublication) {
  57. artifact(remapJar) {
  58. builtBy remapJar
  59. }
  60. artifact(sourcesJar) {
  61. builtBy remapSourcesJar
  62. }
  63. }
  64. }
  65. }