build.gradle 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. plugins {
  2. id "architectury-plugin" version "2.0.65"
  3. id "forgified-fabric-loom" version "0.6.59" apply false
  4. }
  5. architectury {
  6. minecraft = rootProject.minecraft_version
  7. }
  8. subprojects {
  9. apply plugin: "forgified-fabric-loom"
  10. loom {
  11. silentMojangMappingsLicense()
  12. }
  13. }
  14. allprojects {
  15. apply plugin: "java"
  16. apply plugin: "architectury-plugin"
  17. archivesBaseName = rootProject.archives_base_name
  18. version = rootProject.mod_version
  19. group = rootProject.maven_group
  20. tasks.withType(JavaCompile) {
  21. options.encoding = "UTF-8"
  22. // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
  23. // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
  24. // We'll use that if it's available, but otherwise we'll use the older option.
  25. def targetVersion = 8
  26. if (JavaVersion.current().isJava9Compatible()) {
  27. options.release = targetVersion
  28. }
  29. }
  30. java {
  31. withSourcesJar()
  32. }
  33. }