build.gradle 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. buildscript {
  2. repositories {
  3. maven {
  4. name = "BlameJared"
  5. url = 'https://maven.blamejared.com'
  6. }
  7. maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
  8. }
  9. dependencies {
  10. classpath group: 'com.blamejared', name: 'ModTemplate', version: '2.+', changing: true
  11. }
  12. }
  13. plugins {
  14. id 'fabric-loom' version '0.10-SNAPSHOT'
  15. id 'maven-publish'
  16. id 'idea'
  17. id 'com.matthewprenger.cursegradle' version '1.4.0'
  18. }
  19. apply plugin: 'com.blamejared.modtemplate'
  20. import com.blamejared.modtemplate.Utils
  21. archivesBaseName = "${mod_name}-fabric-${minecraft_version}"
  22. version = Utils.updatingVersion(mod_version)
  23. dependencies {
  24. minecraft "com.mojang:minecraft:${minecraft_version}"
  25. mappings loom.officialMojangMappings()
  26. modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
  27. modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
  28. implementation project(":Common")
  29. }
  30. loom {
  31. runs {
  32. client {
  33. client()
  34. setConfigName("Fabric Client")
  35. ideConfigGenerated(true)
  36. runDir("run")
  37. }
  38. server {
  39. server()
  40. setConfigName("Fabric Server")
  41. ideConfigGenerated(true)
  42. runDir("run")
  43. }
  44. }
  45. }
  46. modTemplate {
  47. mcVersion minecraft_version
  48. curseHomepage curse_homepage
  49. displayName mod_name
  50. modLoader "Fabric"
  51. changelog {
  52. enabled true
  53. firstCommit git_first_commit
  54. repo git_repo
  55. }
  56. versionTracker {
  57. enabled true
  58. author mod_author
  59. projectName mod_name
  60. }
  61. webhook {
  62. enabled true
  63. curseId curse_project_id
  64. avatarUrl mod_avatar
  65. }
  66. }
  67. processResources {
  68. from project(":Common").sourceSets.main.resources
  69. inputs.property "version", project.version
  70. filesMatching("fabric.mod.json") {
  71. expand "version": project.version
  72. }
  73. }
  74. tasks.withType(JavaCompile) {
  75. source(project(":Common").sourceSets.main.allSource)
  76. }
  77. jar {
  78. from("LICENSE") {
  79. rename { "${it}_${mod_name}" }
  80. }
  81. }
  82. publishing {
  83. publications {
  84. mavenJava(MavenPublication) {
  85. artifact(remapJar) {
  86. builtBy remapJar
  87. }
  88. artifact(sourcesJar) {
  89. builtBy remapSourcesJar
  90. }
  91. }
  92. }
  93. repositories {
  94. }
  95. }
  96. curseforge {
  97. apiKey = findProperty('curseforge_api_token') ?: 0
  98. def versions = [minecraft_version]
  99. project {
  100. id = curse_project_id
  101. releaseType = 'release'
  102. changelog = file("changelog.md")
  103. changelogType = 'markdown'
  104. addGameVersion "Fabric"
  105. versions.each {
  106. addGameVersion "${it}"
  107. }
  108. mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
  109. afterEvaluate {
  110. uploadTask.dependsOn(remapJar)
  111. }
  112. }
  113. options {
  114. forgeGradleIntegration = false;
  115. }
  116. }