build.gradle 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. plugins {
  2. id "com.github.johnrengelman.shadow" version "5.0.0"
  3. id "com.matthewprenger.cursegradle"
  4. }
  5. loom {
  6. accessWidener = file("src/main/resources/architectury.accessWidener")
  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. developmentFabric.extendsFrom common
  14. }
  15. architectury {
  16. platformSetupLoomIde()
  17. fabric()
  18. }
  19. repositories {
  20. maven { url "https://maven.terraformersmc.com/releases/" }
  21. }
  22. dependencies {
  23. minecraft "com.mojang:minecraft:${rootProject.architectury.minecraft}"
  24. mappings minecraft.officialMojangMappings()
  25. modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
  26. modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
  27. modCompileOnly "com.terraformersmc:modmenu:${rootProject.mod_menu_version}"
  28. implementation "net.jodah:typetools:0.6.2"
  29. shadowCommon "net.jodah:typetools:0.6.2"
  30. common(project(path: ":common", configuration: "namedElements")) { transitive false }
  31. shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
  32. }
  33. processResources {
  34. filesMatching("fabric.mod.json") {
  35. expand "version": project.version
  36. }
  37. inputs.property "version", project.version
  38. }
  39. shadowJar {
  40. exclude "architectury-common.accessWidener"
  41. exclude "architectury.common.json"
  42. relocate "net.jodah.typetools", "me.shedaniel.architectury.shadowed.impl.net.jodah.typetools"
  43. configurations = [project.configurations.shadowCommon]
  44. classifier "shadow"
  45. }
  46. remapJar {
  47. dependsOn(shadowJar)
  48. input.set(shadowJar.archiveFile)
  49. archiveClassifier = "fabric"
  50. }
  51. publishing {
  52. publications {
  53. mavenFabric(MavenPublication) {
  54. artifactId = rootProject.archivesBaseName + "-fabric"
  55. artifact(remapJar.archivePath) {
  56. builtBy build
  57. classifier null
  58. }
  59. }
  60. }
  61. repositories {
  62. if (System.getenv("MAVEN_PASS") != null) {
  63. maven {
  64. url = "https://deploy.shedaniel.me/"
  65. credentials {
  66. username = "shedaniel"
  67. password = System.getenv("MAVEN_PASS")
  68. }
  69. }
  70. }
  71. }
  72. }
  73. curseforge {
  74. if (project.hasProperty("CURSE_API_KEY") || System.getenv("CURSE_API_KEY") != null) {
  75. apiKey = project.hasProperty("CURSE_API_KEY") ? project.property("CURSE_API_KEY") : System.getenv("CURSE_API_KEY")
  76. project {
  77. id = "419697"
  78. releaseType = "release"
  79. changelogType = "html"
  80. changelog = releaseChangelog()
  81. addGameVersion "1.16-Snapshot"
  82. addGameVersion "1.16.4"
  83. addGameVersion "1.16.5"
  84. addGameVersion "Java 8"
  85. addGameVersion "Fabric"
  86. relations {
  87. requiredDependency "fabric-api"
  88. }
  89. mainArtifact(remapJar.archivePath) {
  90. displayName = "[Fabric $rootProject.supported_version] v$project.version"
  91. }
  92. afterEvaluate {
  93. uploadTask.dependsOn("build")
  94. }
  95. }
  96. }
  97. options {
  98. forgeGradleIntegration = false
  99. javaVersionAutoDetect = false
  100. }
  101. }
  102. rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")