build.gradle 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. plugins {
  2. id 'fabric-loom' version '0.6-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. minecraft {
  11. }
  12. repositories {
  13. maven { url "http://maven.terraformersmc.com" }
  14. maven { url "https://maven.shedaniel.me/" }
  15. }
  16. dependencies {
  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 "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  21. modApi "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
  22. include "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
  23. modApi ("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
  24. exclude module: 'fabric-api'
  25. }
  26. include ("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
  27. exclude module: 'fabric-api'
  28. }
  29. modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
  30. }
  31. processResources {
  32. inputs.property "version", project.version
  33. from(sourceSets.main.resources.srcDirs) {
  34. include "fabric.mod.json"
  35. expand "version": project.version
  36. }
  37. from(sourceSets.main.resources.srcDirs) {
  38. exclude "fabric.mod.json"
  39. }
  40. }
  41. // ensure that the encoding is set to UTF-8, no matter what the system default is
  42. // this fixes some edge cases with special characters not displaying correctly
  43. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  44. tasks.withType(JavaCompile) {
  45. options.encoding = "UTF-8"
  46. }
  47. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  48. // if it is present.
  49. // If you remove this task, sources will not be generated.
  50. task sourcesJar(type: Jar, dependsOn: classes) {
  51. classifier = "sources"
  52. from sourceSets.main.allSource
  53. }
  54. jar {
  55. from "LICENSE"
  56. }
  57. // configure the maven publication
  58. publishing {
  59. publications {
  60. mavenJava(MavenPublication) {
  61. // add all the jars that should be included when publishing to maven
  62. artifact(remapJar) {
  63. builtBy remapJar
  64. }
  65. artifact(sourcesJar) {
  66. builtBy remapSourcesJar
  67. }
  68. }
  69. }
  70. // select the repositories you want to publish to
  71. repositories {
  72. // uncomment to publish to the local maven
  73. // mavenLocal()
  74. }
  75. }