build.gradle 3.1 KB

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