diff options
| author | 2024-01-06 10:49:57 +0100 | |
|---|---|---|
| committer | 2024-01-06 10:49:57 +0100 | |
| commit | 5efa03cc90f485c1e4569ec3fea3d6f2e5cc6bfc (patch) | |
| tree | e4c1cdc4788114c3936ea427cb4cc695faa79073 | |
| 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
| -rw-r--r-- | build.gradle | 80 | ||||
| -rw-r--r-- | build.gradle.kts | 99 | ||||
| -rw-r--r-- | gradle.properties | 14 | ||||
| -rw-r--r-- | settings.gradle | 13 | ||||
| -rw-r--r-- | settings.gradle.kts | 20 | ||||
| -rw-r--r-- | src/main/resources/quilt.mod.json | 8 |
6 files changed, 131 insertions, 103 deletions
diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 2c618b9..0000000 --- a/build.gradle +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | plugins { | ||
| 2 | id "maven-publish" | ||
| 3 | id "org.quiltmc.loom" version "1.4.1" | ||
| 4 | } | ||
| 5 | |||
| 6 | base { | ||
| 7 | archivesName = modid | ||
| 8 | } | ||
| 9 | |||
| 10 | version = "0.1+${minecraft_version}" | ||
| 11 | group = groupid | ||
| 12 | |||
| 13 | repositories { | ||
| 14 | maven { | ||
| 15 | url "https://maven.blamejared.com" | ||
| 16 | content { | ||
| 17 | includeGroup "vazkii.patchouli" | ||
| 18 | } | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | loom { | ||
| 23 | mods { | ||
| 24 | "${modid}" { | ||
| 25 | sourceSet("main") | ||
| 26 | } | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | dependencies { | ||
| 31 | minecraft "com.mojang:minecraft:${minecraft_version}" | ||
| 32 | mappings loom.layered { | ||
| 33 | mappings "org.quiltmc:quilt-mappings:${minecraft_version}+build.${quilt_mappings}:intermediary-v2" | ||
| 34 | officialMojangMappings() | ||
| 35 | } | ||
| 36 | modImplementation "org.quiltmc:quilt-loader:${loader_version}" | ||
| 37 | modImplementation "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${quilted_fabric_api_version}-${minecraft_version}" | ||
| 38 | |||
| 39 | modImplementation("vazkii.patchouli:Patchouli:${patchouli_version}") { | ||
| 40 | exclude group: "net.fabricmc", module: "fabric-loader" | ||
| 41 | } | ||
| 42 | |||
| 43 | compileOnly "jakarta.annotation:jakarta.annotation-api:${jakarta_annotation_version}" | ||
| 44 | } | ||
| 45 | |||
| 46 | processResources { | ||
| 47 | inputs.property "version", version | ||
| 48 | |||
| 49 | filesMatching("quilt.mod.json") { | ||
| 50 | expand "version": version | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | tasks.withType(JavaCompile).configureEach { | ||
| 55 | it.options.encoding = "UTF-8" | ||
| 56 | it.options.release = 17 | ||
| 57 | } | ||
| 58 | |||
| 59 | java { | ||
| 60 | sourceCompatibility = JavaVersion.VERSION_17 | ||
| 61 | targetCompatibility = JavaVersion.VERSION_17 | ||
| 62 | |||
| 63 | withSourcesJar() | ||
| 64 | } | ||
| 65 | |||
| 66 | jar { | ||
| 67 | from("LICENSE") { | ||
| 68 | rename { "${it}_${base.archivesName.get()}" } | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | publishing { | ||
| 73 | publications { | ||
| 74 | mavenJava(MavenPublication) { | ||
| 75 | from components.java | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 79 | repositories {} | ||
| 80 | } \ No newline at end of file | ||
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 | } | ||
diff --git a/gradle.properties b/gradle.properties index 6dc6f57..aad323e 100644 --- a/gradle.properties +++ b/gradle.properties | |||
| @@ -4,11 +4,13 @@ org.gradle.parallel = true | |||
| 4 | groupid = lv.enes.mc | 4 | groupid = lv.enes.mc |
| 5 | modid = eris_alchemy | 5 | modid = eris_alchemy |
| 6 | 6 | ||
| 7 | minecraft_version = 1.20.1 | 7 | loomPluginVersion = 1.4.1 |
| 8 | quilt_mappings = 23 | ||
| 9 | loader_version = 0.23.0 | ||
| 10 | quilted_fabric_api_version = 7.4.0+0.90.0 | ||
| 11 | 8 | ||
| 12 | patchouli_version = 1.20.1-84-FABRIC | 9 | minecraftVersion = 1.20.1 |
| 10 | quiltMappings = 23 | ||
| 11 | loaderVersion = 0.23.0 | ||
| 12 | quiltedFabricApiVersion = 7.4.0+0.90.0 | ||
| 13 | 13 | ||
| 14 | jakarta_annotation_version = 2.1.1 \ No newline at end of file | 14 | patchouliVersion = 1.20.1-84-FABRIC |
| 15 | |||
| 16 | jakartaAnnotationVersion = 2.1.1 \ No newline at end of file | ||
diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 1496ea2..0000000 --- a/settings.gradle +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | pluginManagement { | ||
| 2 | repositories { | ||
| 3 | maven { | ||
| 4 | name = "Quilt" | ||
| 5 | url = "https://maven.quiltmc.org/repository/release" | ||
| 6 | } | ||
| 7 | maven { | ||
| 8 | name = "Fabric" | ||
| 9 | url = "https://maven.fabricmc.net/" | ||
| 10 | } | ||
| 11 | gradlePluginPortal() | ||
| 12 | } | ||
| 13 | } \ No newline at end of file | ||
diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..465bf11 --- /dev/null +++ b/settings.gradle.kts | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | pluginManagement { | ||
| 2 | repositories { | ||
| 3 | maven { | ||
| 4 | name = "Quilt" | ||
| 5 | url = uri("https://maven.quiltmc.org/repository/release") | ||
| 6 | } | ||
| 7 | |||
| 8 | maven { | ||
| 9 | name = "Fabric" | ||
| 10 | url = uri("https://maven.fabricmc.net/") | ||
| 11 | } | ||
| 12 | |||
| 13 | gradlePluginPortal() | ||
| 14 | } | ||
| 15 | |||
| 16 | val loomPluginVersion: String by settings | ||
| 17 | plugins { | ||
| 18 | id("org.quiltmc.loom") version loomPluginVersion | ||
| 19 | } | ||
| 20 | } \ No newline at end of file | ||
diff --git a/src/main/resources/quilt.mod.json b/src/main/resources/quilt.mod.json index 5b3e4e8..873c25f 100644 --- a/src/main/resources/quilt.mod.json +++ b/src/main/resources/quilt.mod.json | |||
| @@ -23,17 +23,17 @@ | |||
| 23 | }, | 23 | }, |
| 24 | "depends": [{ | 24 | "depends": [{ |
| 25 | "id": "quilt_loader", | 25 | "id": "quilt_loader", |
| 26 | "versions": ">=0.23.0" | 26 | "versions": "^${loader_version}" |
| 27 | }, { | 27 | }, { |
| 28 | "id": "quilted_fabric_api", | 28 | "id": "quilted_fabric_api", |
| 29 | "versions": ">=7.4.0" | 29 | "versions": "^${quilted_fabric_api_version}" |
| 30 | }, { | 30 | }, { |
| 31 | "id": "minecraft", | 31 | "id": "minecraft", |
| 32 | "versions": "1.20.1" | 32 | "versions": "=${minecraft_version}" |
| 33 | }, { | 33 | }, { |
| 34 | "group": "vazkii.patchouli", | 34 | "group": "vazkii.patchouli", |
| 35 | "id": "patchouli", | 35 | "id": "patchouli", |
| 36 | "versions": ">=1.20.1-84-FABRIC" | 36 | "versions": "^${patchouli_version}" |
| 37 | }] | 37 | }] |
| 38 | }, | 38 | }, |
| 39 | "mixin": "eris_alchemy.mixins.json" | 39 | "mixin": "eris_alchemy.mixins.json" |