build.gradle 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. plugins {
  2. id "com.github.johnrengelman.shadow" version "5.0.0"
  3. id "com.matthewprenger.cursegradle"
  4. }
  5. loom {
  6. mixinConfigs = ["architectury.mixins.json", "architectury-common.mixins.json"]
  7. }
  8. configurations {
  9. shadow
  10. dev
  11. }
  12. artifacts {
  13. dev(jar)
  14. }
  15. architectury {
  16. platformSetupLoomIde()
  17. }
  18. dependencies {
  19. minecraft "com.mojang:minecraft:${rootProject.architectury.minecraft}"
  20. mappings loom.officialMojangMappings()
  21. forge "net.minecraftforge:forge:${rootProject.architectury.minecraft}-${rootProject.forge_version}"
  22. implementation "net.jodah:typetools:0.6.2"
  23. shadow "net.jodah:typetools:0.6.2"
  24. compileOnly(project(path: ":common")) {
  25. transitive = false
  26. }
  27. runtimeOnly(project(path: ":common", configuration: "transformDevelopmentForge")) {
  28. transitive = false
  29. }
  30. shadow(project(path: ":common", configuration: "transformProductionForge")) {
  31. transitive = false
  32. }
  33. }
  34. processResources {
  35. filesMatching("META-INF/mods.toml") {
  36. expand "version": project.version
  37. }
  38. inputs.property "META-INF/mods.toml", project.version
  39. }
  40. shadowJar {
  41. relocate "net.jodah.typetools", "me.shedaniel.architectury.shadowed.impl.net.jodah.typetools"
  42. exclude "fabric.mod.json"
  43. exclude "architectury-common.accessWidener"
  44. configurations = [project.configurations.shadow]
  45. classifier "shadow"
  46. }
  47. remapJar {
  48. dependsOn(shadowJar)
  49. input.set(shadowJar.archivePath)
  50. archiveClassifier = "forge"
  51. }
  52. publishing {
  53. publications {
  54. mavenForge(MavenPublication) {
  55. artifactId = rootProject.archives_base_name + "-fabric"
  56. artifact(remapJar.archivePath) {
  57. builtBy build
  58. classifier null
  59. }
  60. }
  61. }
  62. repositories {
  63. if (System.getenv("MAVEN_PASS") != null) {
  64. maven {
  65. url = "https://deploy.shedaniel.me/"
  66. credentials {
  67. username = "shedaniel"
  68. password = System.getenv("MAVEN_PASS")
  69. }
  70. }
  71. }
  72. }
  73. }
  74. curseforge {
  75. if (project.hasProperty("curse_api_key") || System.getenv("curse_api_key") != null) {
  76. apiKey = project.hasProperty("curse_api_key") ? project.property("curse_api_key") : System.getenv("curse_api_key")
  77. project {
  78. id = "419699"
  79. releaseType = "release"
  80. changelogType = "html"
  81. changelog = releaseChangelog()
  82. addGameVersion "1.16.4"
  83. addGameVersion "1.16.5"
  84. addGameVersion "Java 8"
  85. addGameVersion "Forge"
  86. mainArtifact(remapJar.archivePath) {
  87. displayName = "[Forge $rootProject.supported_version] v$project.version"
  88. }
  89. afterEvaluate {
  90. uploadTask.dependsOn("build")
  91. }
  92. }
  93. }
  94. options {
  95. forgeGradleIntegration = false
  96. javaVersionAutoDetect = false
  97. }
  98. }
  99. rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")