build.gradle 1.0 KB

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