build.gradle 2.5 KB

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