build.gradle 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. modImplementation("com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}")
  20. include("com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}")
  21. modImplementation("io.github.prospector:modmenu:${project.modmenu_version}")
  22. compileOnly("org.projectlombok:lombok:${project.lombok_version}")
  23. annotationProcessor("org.projectlombok:lombok:${project.lombok_version}")
  24. }
  25. processResources {
  26. inputs.property "version", project.version
  27. filesMatching("fabric.mod.json") {
  28. expand "version": project.version
  29. }
  30. }
  31. tasks.withType(JavaCompile).configureEach {
  32. // ensure that the encoding is set to UTF-8, no matter what the system default is
  33. // this fixes some edge cases with special characters not displaying correctly
  34. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  35. it.options.encoding = "UTF-8"
  36. }
  37. java {
  38. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  39. // if it is present.
  40. withSourcesJar()
  41. }
  42. jar {
  43. from "LICENSE"
  44. }
  45. // configure the maven publication
  46. publishing {
  47. publications {
  48. mavenJava(MavenPublication) {
  49. artifact(remapJar) {
  50. builtBy remapJar
  51. }
  52. artifact(sourcesJar) {
  53. builtBy remapSourcesJar
  54. }
  55. }
  56. }
  57. }