build.gradle 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. shadowCommon
  10. dev
  11. }
  12. artifacts {
  13. dev(jar)
  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. implementation(project(path: ":common")) {
  31. transitive = false
  32. }
  33. developmentFabric(project(path: ":common")) {
  34. transitive = false
  35. }
  36. shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) {
  37. transitive = false
  38. }
  39. }
  40. processResources {
  41. filesMatching("fabric.mod.json") {
  42. expand "version": project.version
  43. }
  44. inputs.property "version", project.version
  45. }
  46. shadowJar {
  47. relocate "net.jodah.typetools", "me.shedaniel.architectury.shadowed.impl.net.jodah.typetools"
  48. configurations = [project.configurations.shadowCommon]
  49. classifier "shadow"
  50. }
  51. remapJar {
  52. dependsOn(shadowJar)
  53. input.set(shadowJar.archiveFile)
  54. archiveClassifier = "fabric"
  55. }
  56. publishing {
  57. publications {
  58. mavenFabric(MavenPublication) {
  59. artifactId = rootProject.archivesBaseName + "-fabric"
  60. artifact(remapJar.archivePath) {
  61. builtBy build
  62. classifier null
  63. }
  64. }
  65. }
  66. repositories {
  67. if (System.getenv("MAVEN_PASS") != null) {
  68. maven {
  69. url = "https://deploy.shedaniel.me/"
  70. credentials {
  71. username = "shedaniel"
  72. password = System.getenv("MAVEN_PASS")
  73. }
  74. }
  75. }
  76. }
  77. }
  78. curseforge {
  79. if (project.hasProperty("CURSE_API_KEY") || System.getenv("CURSE_API_KEY") != null) {
  80. apiKey = project.hasProperty("CURSE_API_KEY") ? project.property("CURSE_API_KEY") : System.getenv("CURSE_API_KEY")
  81. project {
  82. id = "419697"
  83. releaseType = "release"
  84. changelogType = "html"
  85. changelog = releaseChangelog()
  86. addGameVersion "1.16-Snapshot"
  87. addGameVersion "1.16.4"
  88. addGameVersion "1.16.5"
  89. addGameVersion "Java 8"
  90. addGameVersion "Fabric"
  91. relations {
  92. requiredDependency "fabric-api"
  93. }
  94. mainArtifact(remapJar.archivePath) {
  95. displayName = "[Fabric $rootProject.supported_version] v$project.version"
  96. }
  97. afterEvaluate {
  98. uploadTask.dependsOn("build")
  99. }
  100. }
  101. }
  102. options {
  103. forgeGradleIntegration = false
  104. javaVersionAutoDetect = false
  105. }
  106. }
  107. rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")