diff options
| author | 2024-01-06 10:49:57 +0100 | |
|---|---|---|
| committer | 2024-01-06 10:49:57 +0100 | |
| commit | 5efa03cc90f485c1e4569ec3fea3d6f2e5cc6bfc (patch) | |
| tree | e4c1cdc4788114c3936ea427cb4cc695faa79073 /build.gradle.kts | |
| parent | Add a hard dependency on patchouli (diff) | |
| download | mc-eris-alchemy-5efa03cc90f485c1e4569ec3fea3d6f2e5cc6bfc.tar.gz mc-eris-alchemy-5efa03cc90f485c1e4569ec3fea3d6f2e5cc6bfc.tar.xz mc-eris-alchemy-5efa03cc90f485c1e4569ec3fea3d6f2e5cc6bfc.zip | |
Build script improvements
Diffstat (limited to 'build.gradle.kts')
| -rw-r--r-- | build.gradle.kts | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..6b30db9 --- /dev/null +++ b/build.gradle.kts | |||
| @@ -0,0 +1,99 @@ | |||
| 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 minecraftVersion: String by project | ||
| 11 | val patchouliVersion: String by project | ||
| 12 | val quiltMappings: String by project | ||
| 13 | val quiltedFabricApiVersion: String by project | ||
| 14 | |||
| 15 | base { | ||
| 16 | archivesName = modid | ||
| 17 | } | ||
| 18 | |||
| 19 | version = "0.1+${minecraftVersion}" | ||
| 20 | group = groupid | ||
| 21 | |||
| 22 | repositories { | ||
| 23 | maven { | ||
| 24 | url = uri("https://maven.blamejared.com") | ||
| 25 | content { | ||
| 26 | includeGroup("vazkii.patchouli") | ||
| 27 | } | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | loom { | ||
| 32 | mods { | ||
| 33 | register(modid) { | ||
| 34 | sourceSet("main") | ||
| 35 | } | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | dependencies { | ||
| 40 | minecraft("com.mojang:minecraft:${minecraftVersion}") | ||
| 41 | mappings(loom.layered { | ||
| 42 | mappings("org.quiltmc:quilt-mappings:${minecraftVersion}+build.${quiltMappings}:intermediary-v2") | ||
| 43 | officialMojangMappings() | ||
| 44 | }) | ||
| 45 | modImplementation("org.quiltmc:quilt-loader:${loaderVersion}") | ||
| 46 | modImplementation("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${quiltedFabricApiVersion}-${minecraftVersion}") | ||
| 47 | |||
| 48 | modImplementation("vazkii.patchouli:Patchouli:${patchouliVersion}") { | ||
| 49 | exclude(group = "net.fabricmc", module = "fabric-loader") | ||
| 50 | } | ||
| 51 | |||
| 52 | compileOnly("jakarta.annotation:jakarta.annotation-api:${jakartaAnnotationVersion}") | ||
| 53 | } | ||
| 54 | |||
| 55 | tasks.processResources { | ||
| 56 | inputs.property("loader_version", loaderVersion) | ||
| 57 | inputs.property("minecraft_version", minecraftVersion) | ||
| 58 | inputs.property("patchouli_version", patchouliVersion) | ||
| 59 | inputs.property("quilted_fabric_api_version", quiltedFabricApiVersion) | ||
| 60 | inputs.property("version", version) | ||
| 61 | |||
| 62 | filesMatching("quilt.mod.json") { | ||
| 63 | expand( | ||
| 64 | "loader_version" to loaderVersion, | ||
| 65 | "minecraft_version" to minecraftVersion, | ||
| 66 | "patchouli_version" to patchouliVersion, | ||
| 67 | "quilted_fabric_api_version" to quiltedFabricApiVersion, | ||
| 68 | "version" to version | ||
| 69 | ) | ||
| 70 | } | ||
| 71 | } | ||
| 72 | |||
| 73 | tasks.withType<JavaCompile>().configureEach { | ||
| 74 | options.encoding = "UTF-8" | ||
| 75 | options.release = 17 | ||
| 76 | } | ||
| 77 | |||
| 78 | java { | ||
| 79 | sourceCompatibility = JavaVersion.VERSION_17 | ||
| 80 | targetCompatibility = JavaVersion.VERSION_17 | ||
| 81 | |||
| 82 | withSourcesJar() | ||
| 83 | } | ||
| 84 | |||
| 85 | tasks.jar { | ||
| 86 | from("LICENSE") { | ||
| 87 | rename { "${it}_${base.archivesName.get()}" } | ||
| 88 | } | ||
| 89 | } | ||
| 90 | |||
| 91 | publishing { | ||
| 92 | publications { | ||
| 93 | create<MavenPublication>("maven") { | ||
| 94 | from(components["java"]) | ||
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | repositories {} | ||
| 99 | } | ||