build.gradle 2.8 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. repositories {
  11. maven {
  12. // Following URL may go offline at some point or another; however i am not sure if we need to archive important things soon.
  13. name = "CottonMC"
  14. url = "https://server.bbkr.space/artifactory/libs-release"
  15. }
  16. maven { url "https://maven.shedaniel.me/" }
  17. maven {
  18. url = "https://maven.terraformersmc.com/releases"
  19. }
  20. }
  21. dependencies {
  22. // to change the versions see the gradle.properties file
  23. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  24. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  25. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  26. // Fabric API. This is technically optional, but you probably want it anyway.
  27. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  28. modImplementation "com.terraformersmc:modmenu:1.16.5"
  29. modImplementation "io.github.cottonmc:LibGui:3.3.5+1.16.5"
  30. modApi("me.shedaniel.cloth:cloth-config-fabric:4.11.14") {
  31. exclude(group: "net.fabricmc.fabric-api")
  32. }
  33. include "me.shedaniel.cloth:cloth-config-fabric:4.11.14"
  34. include "io.github.cottonmc:LibGui:3.3.5+1.16.5"
  35. // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
  36. // You may need to force-disable transitiveness on them.
  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. jcenter()
  82. }
  83. }