build.gradle 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. plugins {
  2. id "architectury-plugin" version "2.0.65"
  3. id "forgified-fabric-loom" version "0.6.54" apply false
  4. id 'com.jfrog.bintray' version '1.8.4'
  5. id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
  6. id 'maven-publish'
  7. }
  8. architectury {
  9. minecraft = rootProject.minecraft_version
  10. }
  11. subprojects {
  12. apply plugin: "forgified-fabric-loom"
  13. loom {
  14. silentMojangMappingsLicense()
  15. useFabricMixin = true
  16. }
  17. }
  18. allprojects {
  19. apply plugin: 'java'
  20. apply plugin: 'architectury-plugin'
  21. ext {
  22. isSnapshot = System.getenv("PR_NUM") != null
  23. }
  24. def runNumber = (System.getenv("GITHUB_RUN_NUMBER") == null ? "9999" : System.getenv("GITHUB_RUN_NUMBER"))
  25. if (!ext.isSnapshot) {
  26. version = rootProject.base_version + "." + runNumber
  27. archivesBaseName = rootProject.archives_base_name
  28. } else {
  29. version = rootProject.base_version + "-PR." + System.getenv("PR_NUM") + "." + runNumber
  30. archivesBaseName = rootProject.archives_base_name_snapshot
  31. }
  32. group = rootProject.maven_group
  33. tasks.withType(JavaCompile) {
  34. options.encoding = "UTF-8"
  35. // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
  36. // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
  37. // We'll use that if it's available, but otherwise we'll use the older option.
  38. def targetVersion = 8
  39. if (JavaVersion.current().isJava9Compatible()) {
  40. options.release = targetVersion
  41. }
  42. }
  43. }
  44. bintray {
  45. user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
  46. key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
  47. publications = ["mavenCommon", "mavenFabric", "mavenForge"]
  48. publish = true
  49. pkg {
  50. repo = "cloth-config-2"
  51. name = "config-2"
  52. userOrg = "shedaniel"
  53. licenses = ["LPGL v3"]
  54. version {
  55. name = project.version
  56. vcsTag = project.version
  57. released = new Date()
  58. desc = "Cloth Config API for Minecraft"
  59. githubRepo = 'architectury/ClothConfig'
  60. websiteUrl = 'https://github.com/architectury/ClothConfig'
  61. issueTrackerUrl = 'https://github.com/architectury/ClothConfig/issues'
  62. vcsUrl = 'https://github.com/architectury/ClothConfig.git'
  63. }
  64. }
  65. }