build.gradle 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. plugins {
  2. id 'fabric-loom' version '0.8-SNAPSHOT'
  3. id 'maven-publish'
  4. }
  5. sourceCompatibility = JavaVersion.VERSION_16
  6. targetCompatibility = JavaVersion.VERSION_16
  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:2.0.0-beta.7"
  29. modImplementation "io.github.cottonmc:LibGui:4.0.0-beta.4+1.17-rc1"
  30. modApi("me.shedaniel.cloth:cloth-config-fabric:5.0.34") {
  31. exclude(group: "net.fabricmc.fabric-api")
  32. }
  33. include "me.shedaniel.cloth:cloth-config-fabric:5.0.34"
  34. include "io.github.cottonmc:LibGui:4.0.0-beta.4+1.17-rc1"
  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. filesMatching("fabric.mod.json") {
  41. expand "version": project.version
  42. }
  43. }
  44. tasks.withType(JavaCompile).configureEach {
  45. // ensure that the encoding is set to UTF-8, no matter what the system default is
  46. // this fixes some edge cases with special characters not displaying correctly
  47. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  48. // If Javadoc is generated, this must be specified in that task too.
  49. it.options.encoding = "UTF-8"
  50. // Minecraft 1.17 (21w19a) upwards uses Java 16.
  51. it.options.release = 16
  52. }
  53. java {
  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 line, sources will not be generated.
  57. withSourcesJar()
  58. }
  59. jar {
  60. from("LICENSE") {
  61. rename { "${it}_${project.archivesBaseName}"}
  62. }
  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. // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
  78. repositories {
  79. // Add repositories to publish to here.
  80. // Notice: This block does NOT have the same function as the block in the top level.
  81. // The repositories here will be used for publishing your artifact, not for
  82. // retrieving dependencies.
  83. }
  84. }