build.gradle 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. plugins {
  2. id 'fabric-loom' version '1.8-SNAPSHOT'
  3. id 'maven-publish'
  4. }
  5. version = project.mod_version
  6. group = project.maven_group
  7. base {
  8. archivesName = project.archives_base_name
  9. }
  10. loom {
  11. splitEnvironmentSourceSets()
  12. mods {
  13. "rogue_block" {
  14. sourceSet sourceSets.main
  15. sourceSet sourceSets.client
  16. }
  17. }
  18. }
  19. repositories {
  20. // Add repositories to retrieve artifacts from in here.
  21. // You should only use this when depending on other mods because
  22. // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
  23. // See https://docs.gradle.org/current/userguide/declaring_repositories.html
  24. // for more information about repositories.
  25. maven { url 'https://maven.nucleoid.xyz/' }
  26. maven { url 'https://jitpack.io' }
  27. maven { url 'https://maven.enginehub.org/repo/' }
  28. maven { url 'https://repo.tbvns.xyz/' }
  29. maven { url 'https://maven.wispforest.io' }
  30. exclusiveContent {
  31. forRepository {
  32. maven {
  33. name = "Modrinth"
  34. url = "https://api.modrinth.com/maven"
  35. }
  36. }
  37. filter {
  38. includeGroup "maven.modrinth"
  39. }
  40. }
  41. }
  42. dependencies {
  43. // To change the versions see the gradle.properties file
  44. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  45. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  46. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  47. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  48. modImplementation 'xyz.nucleoid:fantasy:0.6.4+1.21'
  49. modImplementation 'com.github.WaterMediaTeam.watermedia:build:2.1.1'
  50. modImplementation('com.sk89q.worldedit:worldedit-fabric-mc1.21:7.3.6') {
  51. exclude group: 'com.google.guava', module: 'guava'
  52. exclude group: 'it.unimi.dsi', module: 'fastutil'
  53. }
  54. modImplementation "maven.modrinth:aaa-particles:1.21-1.4.7-fabric"
  55. modImplementation("io.wispforest:owo-lib:${project.owo_version}") {
  56. exclude group: 'com.google.guava', module: 'guava'
  57. exclude group: 'it.unimi.dsi', module: 'fastutil'
  58. }
  59. modImplementation include("net.kyori:adventure-platform-fabric:5.14.1") // for Minecraft 1.21.2-1.21.3
  60. implementation 'com.esotericsoftware.kryo:kryo5:5.6.2'
  61. implementation 'org.reflections:reflections:0.10.2'
  62. include "io.wispforest:owo-sentinel:${project.owo_version}"
  63. compileOnly 'org.projectlombok:lombok:1.18.34'
  64. }
  65. processResources {
  66. inputs.property "version", project.version
  67. inputs.property "minecraft_version", project.minecraft_version
  68. inputs.property "loader_version", project.loader_version
  69. filteringCharset "UTF-8"
  70. filesMatching("fabric.mod.json") {
  71. expand "version": project.version,
  72. "minecraft_version": project.minecraft_version,
  73. "loader_version": project.loader_version
  74. }
  75. }
  76. def targetJavaVersion = 21
  77. tasks.withType(JavaCompile).configureEach {
  78. // ensure that the encoding is set to UTF-8, no matter what the system default is
  79. // this fixes some edge cases with special characters not displaying correctly
  80. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  81. // If Javadoc is generated, this must be specified in that task too.
  82. it.options.encoding = "UTF-8"
  83. if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
  84. it.options.release.set(targetJavaVersion)
  85. }
  86. }
  87. java {
  88. def javaVersion = JavaVersion.toVersion(targetJavaVersion)
  89. if (JavaVersion.current() < javaVersion) {
  90. toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
  91. }
  92. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  93. // if it is present.
  94. // If you remove this line, sources will not be generated.
  95. withSourcesJar()
  96. }
  97. jar {
  98. from("LICENSE") {
  99. rename { "${it}_${project.archivesBaseName}" }
  100. }
  101. }
  102. // configure the maven publication
  103. publishing {
  104. publications {
  105. create("mavenJava", MavenPublication) {
  106. artifactId = project.archives_base_name
  107. from components.java
  108. }
  109. }
  110. // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
  111. repositories {
  112. // Add repositories to publish to here.
  113. // Notice: This block does NOT have the same function as the block in the top level.
  114. // The repositories here will be used for publishing your artifact, not for
  115. // retrieving dependencies.
  116. }
  117. }