build.gradle 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. plugins {
  2. id "fabric-loom"
  3. id "com.github.johnrengelman.shadow" version "5.0.0"
  4. id "com.matthewprenger.cursegradle"
  5. }
  6. loom {
  7. accessWidener(file("src/main/resources/architectury.accessWidener"))
  8. }
  9. configurations {
  10. shadow
  11. }
  12. dependencies {
  13. minecraft("com.mojang:minecraft:${rootProject.architect.minecraft}")
  14. mappings(minecraft.officialMojangMappings())
  15. modCompile("net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}")
  16. modCompile("net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}")
  17. modCompileOnly("io.github.prospector:modmenu:${rootProject.mod_menu_version}")
  18. implementation "net.jodah:typetools:0.6.2"
  19. shadow "net.jodah:typetools:0.6.2"
  20. compileOnly(project(path: ":common")) {
  21. transitive = false
  22. }
  23. runtimeOnly(project(path: ":common", configuration: "transformed")) {
  24. transitive = false
  25. }
  26. shadow(project(path: ":common", configuration: "transformed")) {
  27. transitive = false
  28. }
  29. }
  30. processResources {
  31. filesMatching("fabric.mod.json") {
  32. expand "version": project.version
  33. }
  34. inputs.property "version", project.version
  35. }
  36. shadowJar {
  37. relocate "net.jodah.typetools", "me.shedaniel.architectury.shadowed.impl.net.jodah.typetools"
  38. configurations = [project.configurations.shadow]
  39. classifier "shadow"
  40. }
  41. remapJar {
  42. dependsOn(shadowJar)
  43. input.set(shadowJar.archivePath)
  44. archiveClassifier = "fabric"
  45. }
  46. publishing {
  47. publications {
  48. mavenFabric(MavenPublication) {
  49. artifact(remapJar.archivePath) {
  50. builtBy build
  51. classifier "fabric"
  52. }
  53. }
  54. }
  55. }
  56. curseforge {
  57. if (project.hasProperty("curse_api_key") || System.getenv("curse_api_key") != null) {
  58. apiKey = project.hasProperty("curse_api_key") ? project.property("curse_api_key") : System.getenv("curse_api_key")
  59. project {
  60. id = "419697"
  61. releaseType = "release"
  62. changelogType = "html"
  63. changelog = releaseChangelog()
  64. addGameVersion "1.16-Snapshot"
  65. addGameVersion "1.16.4"
  66. addGameVersion "Java 8"
  67. addGameVersion "Fabric"
  68. relations {
  69. requiredDependency "fabric-api"
  70. }
  71. mainArtifact(remapJar.archivePath) {
  72. displayName = "[Fabric $rootProject.supported_version] v$project.version"
  73. }
  74. afterEvaluate {
  75. uploadTask.dependsOn("build")
  76. }
  77. }
  78. }
  79. options {
  80. forgeGradleIntegration = false
  81. javaVersionAutoDetect = false
  82. }
  83. }
  84. rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")