build.gradle 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. plugins {
  2. id 'fabric-loom' version '0.4-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. dependencies {
  11. //to change the versions see the gradle.properties file
  12. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  13. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  14. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  15. // Fabric API. This is technically optional, but you probably want it anyway.
  16. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  17. modImplementation "io.github.prospector:modmenu:1.14.6+build.31"
  18. modApi("me.shedaniel.cloth:config-2:4.8.1") {
  19. exclude(group: "net.fabricmc.fabric-api")
  20. }
  21. modApi("me.sargunvohra.mcmods:autoconfig1u:3.2.0-unstable") {
  22. exclude(group: "net.fabricmc.fabric-api")
  23. }
  24. include "me.shedaniel.cloth:config-2:4.8.1"
  25. include "me.sargunvohra.mcmods:autoconfig1u:3.2.0-unstable"
  26. // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
  27. // You may need to force-disable transitiveness on them.
  28. }
  29. processResources {
  30. inputs.property "version", project.version
  31. from(sourceSets.main.resources.srcDirs) {
  32. include "fabric.mod.json"
  33. expand "version": project.version
  34. }
  35. from(sourceSets.main.resources.srcDirs) {
  36. exclude "fabric.mod.json"
  37. }
  38. }
  39. // ensure that the encoding is set to UTF-8, no matter what the system default is
  40. // this fixes some edge cases with special characters not displaying correctly
  41. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  42. tasks.withType(JavaCompile) {
  43. options.encoding = "UTF-8"
  44. }
  45. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  46. // if it is present.
  47. // If you remove this task, sources will not be generated.
  48. task sourcesJar(type: Jar, dependsOn: classes) {
  49. classifier = "sources"
  50. from sourceSets.main.allSource
  51. }
  52. jar {
  53. from "LICENSE"
  54. }
  55. // configure the maven publication
  56. publishing {
  57. publications {
  58. mavenJava(MavenPublication) {
  59. // add all the jars that should be included when publishing to maven
  60. artifact(remapJar) {
  61. builtBy remapJar
  62. }
  63. artifact(sourcesJar) {
  64. builtBy remapSourcesJar
  65. }
  66. }
  67. }
  68. // select the repositories you want to publish to
  69. repositories {
  70. // uncomment to publish to the local maven
  71. // mavenLocal()
  72. jcenter()
  73. }
  74. }