build.gradle 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. common
  10. shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
  11. compileClasspath.extendsFrom common
  12. runtimeClasspath.extendsFrom common
  13. developmentForge.extendsFrom common
  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. common(project(path: ":common", configuration: "namedElements")) { transitive false }
  26. shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive false }
  27. }
  28. processResources {
  29. filesMatching("META-INF/mods.toml") {
  30. expand "version": project.version
  31. }
  32. inputs.property "META-INF/mods.toml", project.version
  33. }
  34. shadowJar {
  35. relocate "net.jodah.typetools", "me.shedaniel.architectury.shadowed.impl.net.jodah.typetools"
  36. exclude "fabric.mod.json"
  37. exclude "architectury-common.accessWidener"
  38. exclude "architectury.common.json"
  39. configurations = [project.configurations.shadowCommon]
  40. classifier "shadow"
  41. }
  42. remapJar {
  43. dependsOn(shadowJar)
  44. input.set(shadowJar.archivePath)
  45. archiveClassifier = "forge"
  46. }
  47. publishing {
  48. publications {
  49. mavenForge(MavenPublication) {
  50. artifactId = rootProject.archivesBaseName + "-forge"
  51. artifact(remapJar.archivePath) {
  52. builtBy build
  53. classifier null
  54. }
  55. }
  56. }
  57. repositories {
  58. if (System.getenv("MAVEN_PASS") != null) {
  59. maven {
  60. url = "https://deploy.shedaniel.me/"
  61. credentials {
  62. username = "shedaniel"
  63. password = System.getenv("MAVEN_PASS")
  64. }
  65. }
  66. }
  67. }
  68. }
  69. curseforge {
  70. if (project.hasProperty("CURSE_API_KEY") || System.getenv("CURSE_API_KEY") != null) {
  71. apiKey = project.hasProperty("CURSE_API_KEY") ? project.property("CURSE_API_KEY") : System.getenv("CURSE_API_KEY")
  72. project {
  73. id = "419699"
  74. releaseType = "release"
  75. changelogType = "html"
  76. changelog = releaseChangelog()
  77. addGameVersion "1.16.4"
  78. addGameVersion "1.16.5"
  79. addGameVersion "Java 8"
  80. addGameVersion "Forge"
  81. mainArtifact(remapJar.archivePath) {
  82. displayName = "[Forge $rootProject.supported_version] v$project.version"
  83. }
  84. afterEvaluate {
  85. uploadTask.dependsOn("build")
  86. }
  87. }
  88. }
  89. options {
  90. forgeGradleIntegration = false
  91. javaVersionAutoDetect = false
  92. }
  93. }
  94. rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")