build.gradle 2.6 KB

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