build.gradle 2.7 KB

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