build.gradle 3.1 KB

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