build.gradle 2.0 KB

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