build.gradle 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
  21. modApi "com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}"
  22. include "com.gitlab.Lortseam:completeconfig:${project.completeconfig_version}"
  23. include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
  24. compileOnly "org.projectlombok:lombok:${project.lombok_version}"
  25. annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
  26. }
  27. processResources {
  28. inputs.property "version", project.version
  29. from(sourceSets.main.resources.srcDirs) {
  30. include "fabric.mod.json"
  31. expand "version": project.version
  32. }
  33. from(sourceSets.main.resources.srcDirs) {
  34. exclude "fabric.mod.json"
  35. }
  36. }
  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. tasks.withType(JavaCompile) {
  41. options.encoding = "UTF-8"
  42. }
  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 task, sources will not be generated.
  46. task sourcesJar(type: Jar, dependsOn: classes) {
  47. classifier = "sources"
  48. from sourceSets.main.allSource
  49. }
  50. jar {
  51. from "LICENSE"
  52. }
  53. // configure the maven publication
  54. publishing {
  55. publications {
  56. mavenJava(MavenPublication) {
  57. // add all the jars that should be included when publishing to maven
  58. artifact(remapJar) {
  59. builtBy remapJar
  60. }
  61. artifact(sourcesJar) {
  62. builtBy remapSourcesJar
  63. }
  64. }
  65. }
  66. }