build.gradle 3.0 KB

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