diff options
| author | 2024-01-27 08:36:24 +0200 | |
|---|---|---|
| committer | 2024-01-27 08:36:24 +0200 | |
| commit | 0e5bf79b8093d82c5d4cd7587abaa2bf41fd1ffa (patch) | |
| tree | 27a939dae027e78b1472e67cc49e7c4451eba01d /build.gradle.kts | |
| download | mc-eriscraft-misc-main.tar.gz mc-eriscraft-misc-main.tar.xz mc-eriscraft-misc-main.zip | |
Diffstat (limited to 'build.gradle.kts')
| -rw-r--r-- | build.gradle.kts | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..81b16a8 --- /dev/null +++ b/build.gradle.kts | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | plugins { | ||
| 2 | `maven-publish` | ||
| 3 | id("org.quiltmc.loom") | ||
| 4 | } | ||
| 5 | |||
| 6 | val groupid: String by project | ||
| 7 | val jakartaAnnotationVersion: String by project | ||
| 8 | val loaderVersion: String by project | ||
| 9 | val modid: String by project | ||
| 10 | val modVersion: String by project | ||
| 11 | val minecraftVersion: String by project | ||
| 12 | val quiltMappings: String by project | ||
| 13 | val wthitVersion: String by project | ||
| 14 | |||
| 15 | group = groupid | ||
| 16 | version = modVersion | ||
| 17 | |||
| 18 | repositories { | ||
| 19 | maven { | ||
| 20 | // For WTHIT | ||
| 21 | url = uri("https://maven2.bai.lol") | ||
| 22 | content { | ||
| 23 | includeGroup("lol.bai") | ||
| 24 | includeGroup("mcp.mobius.waila") | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | loom { | ||
| 30 | mods { | ||
| 31 | register(modid) { | ||
| 32 | sourceSet("main") | ||
| 33 | } | ||
| 34 | } | ||
| 35 | } | ||
| 36 | |||
| 37 | dependencies { | ||
| 38 | minecraft("com.mojang:minecraft:${minecraftVersion}") | ||
| 39 | mappings(loom.layered { | ||
| 40 | mappings("org.quiltmc:quilt-mappings:${minecraftVersion}+build.${quiltMappings}:intermediary-v2") | ||
| 41 | officialMojangMappings() | ||
| 42 | }) | ||
| 43 | modImplementation("org.quiltmc:quilt-loader:${loaderVersion}") | ||
| 44 | |||
| 45 | modCompileOnly("mcp.mobius.waila:wthit-api:quilt-${wthitVersion}") | ||
| 46 | |||
| 47 | compileOnly("jakarta.annotation:jakarta.annotation-api:${jakartaAnnotationVersion}") | ||
| 48 | } | ||
| 49 | |||
| 50 | java { | ||
| 51 | toolchain { | ||
| 52 | languageVersion.set(JavaLanguageVersion.of(17)) | ||
| 53 | } | ||
| 54 | |||
| 55 | withJavadocJar() | ||
| 56 | withSourcesJar() | ||
| 57 | } | ||
| 58 | |||
| 59 | publishing { | ||
| 60 | publications { | ||
| 61 | create<MavenPublication>("maven") { | ||
| 62 | from(components["java"]) | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | repositories { | ||
| 67 | maven { | ||
| 68 | url = uri("https://mvn.enes.lv/") | ||
| 69 | credentials { | ||
| 70 | username = (findProperty("mvnUsername") ?: System.getenv("MVN_USERNAME")).toString() | ||
| 71 | password = (findProperty("mvnPassword") ?: System.getenv("MVN_PASSWORD")).toString() | ||
| 72 | } | ||
| 73 | } | ||
| 74 | } | ||
| 75 | } | ||
| 76 | |||
| 77 | tasks.processResources { | ||
| 78 | inputs.property("loader_version", loaderVersion) | ||
| 79 | inputs.property("minecraft_version", minecraftVersion) | ||
| 80 | inputs.property("version", version) | ||
| 81 | |||
| 82 | filesMatching("quilt.mod.json") { | ||
| 83 | expand( | ||
| 84 | "loader_version" to loaderVersion, | ||
| 85 | "minecraft_version" to minecraftVersion, | ||
| 86 | "version" to version | ||
| 87 | ) | ||
| 88 | } | ||
| 89 | } | ||
| 90 | |||
| 91 | tasks.withType<JavaCompile>().configureEach { | ||
| 92 | options.encoding = "UTF-8" | ||
| 93 | options.release = 17 | ||
| 94 | } | ||
| 95 | |||
| 96 | tasks.javadoc { | ||
| 97 | (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) | ||
| 98 | } | ||
| 99 | |||
| 100 | tasks.jar { | ||
| 101 | from("LICENSE") { | ||
| 102 | rename { "${it}_${name}" } | ||
| 103 | } | ||
| 104 | } | ||