build.gradle 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. plugins {
  2. id "com.github.johnrengelman.shadow" version "5.0.0"
  3. id "com.matthewprenger.cursegradle"
  4. }
  5. loom {
  6. mixinConfig = "architectury.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. artifact(remapJar.archivePath) {
  56. builtBy build
  57. classifier "forge"
  58. }
  59. }
  60. }
  61. }
  62. curseforge {
  63. if (project.hasProperty("curse_api_key") || System.getenv("curse_api_key") != null) {
  64. apiKey = project.hasProperty("curse_api_key") ? project.property("curse_api_key") : System.getenv("curse_api_key")
  65. project {
  66. id = "419699"
  67. releaseType = "release"
  68. changelogType = "html"
  69. changelog = releaseChangelog()
  70. addGameVersion "1.16.4"
  71. addGameVersion "1.16.5"
  72. addGameVersion "Java 8"
  73. addGameVersion "Forge"
  74. mainArtifact(remapJar.archivePath) {
  75. displayName = "[Forge $rootProject.supported_version] v$project.version"
  76. }
  77. afterEvaluate {
  78. uploadTask.dependsOn("build")
  79. }
  80. }
  81. }
  82. options {
  83. forgeGradleIntegration = false
  84. javaVersionAutoDetect = false
  85. }
  86. }
  87. rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")