build.gradle 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. plugins {
  2. id "architectury-plugin" version "3.1-SNAPSHOT"
  3. id "forgified-fabric-loom" version "0.6-SNAPSHOT" apply false
  4. id "com.matthewprenger.cursegradle" version "1.4.0" apply false
  5. id "maven-publish"
  6. id "org.cadixdev.licenser" version "0.5.0" apply false
  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. apply plugin: 'org.cadixdev.licenser'
  22. def runNumber = (System.getenv("GITHUB_RUN_NUMBER") == null ? "9999" : System.getenv("GITHUB_RUN_NUMBER"))
  23. version = rootProject.base_version + "." + runNumber
  24. archivesBaseName = rootProject.archives_base_name
  25. group = rootProject.maven_group
  26. tasks.withType(JavaCompile) {
  27. options.encoding = "UTF-8"
  28. // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
  29. // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
  30. // We'll use that if it's available, but otherwise we'll use the older option.
  31. def targetVersion = 8
  32. if (JavaVersion.current().isJava9Compatible()) {
  33. options.release = targetVersion
  34. }
  35. }
  36. license {
  37. header = rootProject.file("HEADER")
  38. ext {
  39. name = "shedaniel"
  40. year = "2020 - 2021"
  41. }
  42. include "**/*.java"
  43. exclude "**/ScrollingContainer.java"
  44. ignoreFailures = true
  45. }
  46. }
  47. task licenseFormatAll
  48. subprojects { licenseFormatAll.dependsOn("${path}:licenseFormat") }
  49. task curseforgePublish