build.gradle 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import java.util.stream.Collectors
  2. plugins {
  3. id "architectury-plugin" version "3.4-SNAPSHOT"
  4. id "dev.architectury.loom" version "0.10.0-SNAPSHOT" apply false
  5. }
  6. architectury {
  7. minecraft = rootProject.minecraft_version
  8. }
  9. subprojects {
  10. apply plugin: "dev.architectury.loom"
  11. loom {
  12. silentMojangMappingsLicense()
  13. }
  14. task signJar(description: "Sign jar") {
  15. doLast {
  16. if (project.hasProperty('keyStore')) {
  17. def path = remapJar.archivePath
  18. logger.info("Signing " + path + "\n")
  19. ant.signjar(jar: path,
  20. alias: project.storeAlias,
  21. keystore: project.keyStore,
  22. storepass: project.storePass,
  23. keypass: project.storePass
  24. )
  25. } else {
  26. logger.warn("No key store found, not signing the output jar\n")
  27. }
  28. }
  29. }
  30. build.dependsOn signJar
  31. dependencies {
  32. minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
  33. mappings minecraft.officialMojangMappings()
  34. }
  35. }
  36. allprojects {
  37. apply plugin: "java"
  38. apply plugin: "architectury-plugin"
  39. archivesBaseName = rootProject.archives_base_name
  40. version = rootProject.mod_version
  41. group = rootProject.maven_group
  42. tasks.withType(JavaCompile) {
  43. options.encoding = "UTF-8"
  44. options.release = 16
  45. }
  46. java {
  47. withSourcesJar()
  48. }
  49. def customGradle = project.file('custom.gradle');
  50. if (customGradle.exists()) {
  51. apply from: customGradle;
  52. }
  53. }