build.gradle 2.5 KB

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