build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. plugins {
  2. id "architectury-plugin" version "1.3.47"
  3. id "forgified-fabric-loom" version "0.5.29" apply false
  4. id "org.cadixdev.licenser" version "0.5.0"
  5. id "com.jfrog.bintray" version "1.8.4"
  6. id "com.matthewprenger.cursegradle" version "1.4.0" apply false
  7. id "maven"
  8. id "maven-publish"
  9. }
  10. architectury {
  11. minecraft = rootProject.minecraft_version
  12. }
  13. subprojects {
  14. apply plugin: "forgified-fabric-loom"
  15. dependencies {
  16. testCompile sourceSets.main.output
  17. }
  18. }
  19. allprojects {
  20. apply plugin: "java"
  21. apply plugin: "architectury-plugin"
  22. apply plugin: "org.cadixdev.licenser"
  23. archivesBaseName = rootProject.archives_base_name
  24. version = rootProject.mod_version + "." + (System.getenv("GITHUB_RUN_NUMBER") == null ? "9999" : System.getenv("GITHUB_RUN_NUMBER"))
  25. group = rootProject.maven_group
  26. tasks.withType(JavaCompile) {
  27. options.encoding = "UTF-8"
  28. }
  29. license {
  30. header = rootProject.file("HEADER")
  31. ext {
  32. name = "shedaniel"
  33. year = "2020, 2021"
  34. }
  35. include "**/*.java"
  36. exclude "**/NbtType.java"
  37. ignoreFailures = true
  38. }
  39. ext {
  40. releaseChangelog = {
  41. def dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm")
  42. dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"))
  43. def branch
  44. if (System.env.BRANCH_NAME) {
  45. branch = System.env.BRANCH_NAME
  46. branch = branch.substring(branch.lastIndexOf("/") + 1)
  47. } else {
  48. branch = "git rev-parse --abbrev-ref HEAD".execute().in.text.trim()
  49. }
  50. if (branch == "HEAD") {
  51. branch = "git rev-parse --short HEAD".execute().in.text.trim()
  52. }
  53. def time = dateFormat.format(new Date())
  54. def changes = new StringBuilder()
  55. changes << "<h2>Architectury v$project.version for $project.supported_version</h2>Updated at <b>$time</b>.<br><a href=\"https://www.github.com/architectury/architectury/commits/$branch\">Click here for changelog</a>"
  56. def proc = "git log --max-count=200 --pretty=format:%s".execute()
  57. proc.in.eachLine { line ->
  58. def processedLine = line.toString()
  59. if (!processedLine.contains("New translations") && !processedLine.contains("Merge") && !processedLine.contains("branch")) {
  60. changes << "<br>- ${processedLine.capitalize()}"
  61. }
  62. }
  63. proc.waitFor()
  64. return changes.toString()
  65. }
  66. }
  67. }
  68. task licenseFormatAll
  69. subprojects { p -> licenseFormatAll.dependsOn("${p.path}:licenseFormat") }
  70. bintray {
  71. user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
  72. key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
  73. publications = ["mavenCommon", "mavenFabric", "mavenForge"]
  74. publish = true
  75. pkg {
  76. repo = "cloth"
  77. name = "architectury"
  78. userOrg = "shedaniel"
  79. licenses = ["Apache-2.0"]
  80. version {
  81. vcsUrl = "https://github.com/shedaniel/architectury.git"
  82. }
  83. }
  84. }
  85. task curseforgePublish