build.gradle 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //file:noinspection GradlePackageVersionRange
  2. plugins {
  3. id "fabric-loom" version "1.0.+"
  4. id "io.github.juuxel.loom-quiltflower" version "1.+"
  5. id "org.quiltmc.quilt-mappings-on-loom" version "4.2.0"
  6. id "maven-publish"
  7. }
  8. loom {
  9. accessWidenerPath = file("src/main/resources/twilightforest.accesswidener")
  10. }
  11. sourceCompatibility = JavaVersion.VERSION_17
  12. targetCompatibility = JavaVersion.VERSION_17
  13. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  14. archivesBaseName = "${project.mod_id}-fabric-${minecraft_version}"
  15. version = (hasProperty("CIRevision") ? CIRevision : project.mod_version)
  16. group = project.group_name
  17. sourceSets.main.resources {
  18. srcDir "src/generated/resources"
  19. }
  20. repositories {
  21. mavenLocal() // test builds of Porting Lib
  22. maven { url = "https://cursemaven.com" } // Forge Config API Port
  23. maven { url = "https://api.modrinth.com/maven" } // LazyDFU, Suggestion Tweaker
  24. maven { url = "https://maven.shedaniel.me/" } // Cloth Config
  25. maven { url = "https://maven.wispforest.io" } // TOP
  26. maven { url = "https://storage.googleapis.com/devan-maven/" }
  27. maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu, Trinkets
  28. maven { url = "https://mvn.devos.one/snapshots/" } // Porting Lib, Forge Tags, Tinkers, Mantle
  29. maven { url = "https://ladysnake.jfrog.io/artifactory/mods" } // Cardinal Components API
  30. maven { url = "https://maven.parchmentmc.net/" } // Parchment
  31. maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
  32. maven {
  33. url = "https://jitpack.io" // Fabric ASM, Mixin Extras
  34. content {
  35. includeGroup("com.github.LlamaLad7")
  36. includeGroup("com.github.Chocohead")
  37. }
  38. }
  39. }
  40. dependencies {
  41. // dev env
  42. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  43. mappings loom.officialMojangMappings()
  44. modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
  45. modLocalRuntime("me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}") { exclude(group: "net.fabricmc.fabric-api") }
  46. modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}") { exclude(group: "net.fabricmc.fabric-api") }
  47. modLocalRuntime("dev.architectury:architectury-fabric:${project.architectury_version}") { exclude(group: "net.fabricmc.fabric-api") } // for REI
  48. modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}") { exclude(group: "net.fabricmc.fabric-api") }
  49. modLocalRuntime("maven.modrinth:lazydfu:0.1.2")
  50. modLocalRuntime("maven.modrinth:suggestion-tweaker:${project.suggestion_tweaker_version}")
  51. modLocalRuntime("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { exclude(group: "net.fabricmc.fabric-api") } // for Suggestion Tweaker
  52. // dependencies
  53. modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
  54. modImplementation(include(fabricApi.module("fabric-data-generation-api-v1", project.fabric_version))) // include datagen api since FAPI fatjar doesn't
  55. modImplementation(include("io.github.fabricators_of_create:Porting-Lib:${project.port_lib_version}+${project.minecraft_version}"))
  56. modImplementation(include("com.jamieswhiteshirt:reach-entity-attributes:${project.reach_entity_attributes_version}"))
  57. modImplementation(include("curse.maven:forge-config-api-port-fabric-547434:${project.config_api_version}"))
  58. modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"))
  59. modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}"))
  60. modImplementation(include("com.github.Chocohead:Fabric-ASM:v2.3"))
  61. modImplementation(include("me.alphamode:ForgeTags:2.1"))
  62. modImplementation(include("maven.modrinth:here-be-no-dragons:1.0.0"))
  63. implementation(include("com.electronwill.night-config:core:3.6.3"))
  64. implementation(include("com.electronwill.night-config:toml:3.6.3"))
  65. implementation(include("javax.annotation:javax.annotation-api:1.3.2"))
  66. implementation(include("com.google.code.findbugs:jsr305:3.0.2"))
  67. // compat
  68. modCompileOnly("slimeknights.tconstruct:TConstruct:${project.minecraft_version}-${project.tcon_version}") { exclude(group: "io.github.fabricators_of_create") }
  69. modImplementation("dev.emi:trinkets:${project.trinkets_version}")
  70. }
  71. loom {
  72. runs {
  73. datagen {
  74. client()
  75. name "Data Generation"
  76. vmArg "-Dfabric-api.datagen"
  77. vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}"
  78. vmArg "-Dfabric-api.datagen.modid=twilightforest"
  79. property "twilightforest.data.existingData", file("src/main/resources").absolutePath
  80. runDir "build/datagen"
  81. }
  82. }
  83. }
  84. processResources {
  85. inputs.property "version", project.version
  86. filesMatching("fabric.mod.json") {
  87. expand "version": project.version
  88. }
  89. }
  90. tasks.withType(JavaCompile).configureEach {
  91. it.options.encoding = "UTF-8"
  92. it.options.release = 17
  93. }
  94. java {
  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. mavenJava(MavenPublication) {
  106. from components.java
  107. }
  108. }
  109. // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
  110. repositories {
  111. // Add repositories to publish to here.
  112. // Notice: This block does NOT have the same function as the block in the top level.
  113. // The repositories here will be used for publishing your artifact, not for
  114. // retrieving dependencies.
  115. }
  116. }