build.gradle 1.6 KB

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