From e8327312cbd3532544fc1d65a4364be63b3cf1c0 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Mon, 5 Aug 2024 20:04:22 +0200 Subject: [PATCH] Pass description into mod files via Gradle as well --- build.gradle | 30 +++++++++++-------- gradle.properties | 1 + viaforge-mc1122/src/main/resources/mcmod.info | 2 +- .../src/main/resources/META-INF/mods.toml | 4 +-- .../src/main/resources/META-INF/mods.toml | 4 +-- .../src/main/resources/META-INF/mods.toml | 4 +-- .../src/main/resources/META-INF/mods.toml | 4 +-- .../src/main/resources/META-INF/mods.toml | 4 +-- .../src/main/resources/META-INF/mods.toml | 4 +-- 9 files changed, 25 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index 4dc5221..3451f3c 100644 --- a/build.gradle +++ b/build.gradle @@ -46,20 +46,8 @@ allprojects { } } - // Replace the version in the mcmod.info and mods.toml files with the project version - // Since this depends on the platform version, we can't define it in the global scope :( - tasks { - processResources { - for (final def file in ["mcmod.info", "META-INF/mods.toml"]) { - filesMatching(file) { - expand "version": project.version - } - } - } - } - - // Including all required libraries for ViaVersion {for version numbers see gradle.properties} dependencies { + // For common source code compileOnly "io.netty:netty-all:4.1.112.Final" library "com.viaversion:viaversion-common:5.0.3-SNAPSHOT" @@ -85,6 +73,7 @@ subprojects { group = project.maven_group archivesName = project.name version = project.maven_version + description = project.maven_description } def mcVersion = project.forge_version.split("-")[0] @@ -140,6 +129,21 @@ subprojects { library project(":") // Include the base project, to get Common-ViaForge } + // Replace the version in the mcmod.info and mods.toml files with the project version + // Since this depends on the platform version, we can't define it in the global scope :( + tasks { + processResources { + for (final def file in ["mcmod.info", "META-INF/mods.toml"]) { + filesMatching(file) { + expand ( + "version": project.version, + "description": project.description + ) + } + } + } + } + mixin { add sourceSets.main, "mixins.${project.name}.refmap.json" } diff --git a/gradle.properties b/gradle.properties index 58d2557..9fa14d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,7 @@ org.gradle.daemon=false # Project Details maven_group=de.florianmichael maven_version=3.7.1-SNAPSHOT +maven_description=Client-side Implementation of the Via* projects for Minecraft Forge slf4j_version=2.0.7 mixin_version=0.8.3 diff --git a/viaforge-mc1122/src/main/resources/mcmod.info b/viaforge-mc1122/src/main/resources/mcmod.info index ade6318..2a932b8 100644 --- a/viaforge-mc1122/src/main/resources/mcmod.info +++ b/viaforge-mc1122/src/main/resources/mcmod.info @@ -2,7 +2,7 @@ { "modid": "viaforge", "name": "ViaForge", - "description": "Client-side Implementation of the Via* projects for Minecraft Forge", + "description": "${description}", "version": "${version}", "mcversion": "[1.12,)", "url": "https://github.com/ViaVersion/ViaForge", diff --git a/viaforge-mc1165/src/main/resources/META-INF/mods.toml b/viaforge-mc1165/src/main/resources/META-INF/mods.toml index ea6f333..d275e6c 100644 --- a/viaforge-mc1165/src/main/resources/META-INF/mods.toml +++ b/viaforge-mc1165/src/main/resources/META-INF/mods.toml @@ -13,6 +13,4 @@ displayURL="https://github.com/FlorianMichael" logoFile="icon.png" credits="Github contributors" authors="FlorianMichael/EnZaXD" -description=''' - Client-side Implementation of the Via* projects for Minecraft Forge - ''' \ No newline at end of file +description="${description}" \ No newline at end of file diff --git a/viaforge-mc1171/src/main/resources/META-INF/mods.toml b/viaforge-mc1171/src/main/resources/META-INF/mods.toml index 505c342..d37ffcb 100644 --- a/viaforge-mc1171/src/main/resources/META-INF/mods.toml +++ b/viaforge-mc1171/src/main/resources/META-INF/mods.toml @@ -13,6 +13,4 @@ displayURL="https://github.com/FlorianMichael" logoFile="icon.png" credits="Github contributors" authors="FlorianMichael/EnZaXD" -description=''' - Client-side Implementation of the Via* projects for Minecraft Forge - ''' \ No newline at end of file +description="${description}" \ No newline at end of file diff --git a/viaforge-mc1182/src/main/resources/META-INF/mods.toml b/viaforge-mc1182/src/main/resources/META-INF/mods.toml index a1c8db3..827d07f 100644 --- a/viaforge-mc1182/src/main/resources/META-INF/mods.toml +++ b/viaforge-mc1182/src/main/resources/META-INF/mods.toml @@ -13,6 +13,4 @@ displayURL="https://github.com/FlorianMichael" logoFile="icon.png" credits="Github contributors" authors="FlorianMichael/EnZaXD" -description=''' - Client-side Implementation of the Via* projects for Minecraft Forge - ''' \ No newline at end of file +description="${description}" \ No newline at end of file diff --git a/viaforge-mc1192/src/main/resources/META-INF/mods.toml b/viaforge-mc1192/src/main/resources/META-INF/mods.toml index e2463bf..7ccc9b4 100644 --- a/viaforge-mc1192/src/main/resources/META-INF/mods.toml +++ b/viaforge-mc1192/src/main/resources/META-INF/mods.toml @@ -13,6 +13,4 @@ displayURL="https://github.com/FlorianMichael" logoFile="icon.png" credits="Github contributors" authors="FlorianMichael/EnZaXD" -description=''' - Client-side Implementation of the Via* projects for Minecraft Forge - ''' \ No newline at end of file +description="${description}" \ No newline at end of file diff --git a/viaforge-mc1194/src/main/resources/META-INF/mods.toml b/viaforge-mc1194/src/main/resources/META-INF/mods.toml index f4914d8..14888ad 100644 --- a/viaforge-mc1194/src/main/resources/META-INF/mods.toml +++ b/viaforge-mc1194/src/main/resources/META-INF/mods.toml @@ -13,6 +13,4 @@ displayURL="https://github.com/FlorianMichael" logoFile="icon.png" credits="Github contributors" authors="FlorianMichael/EnZaXD" -description=''' - Client-side Implementation of the Via* projects for Minecraft Forge - ''' \ No newline at end of file +description="${description}" \ No newline at end of file diff --git a/viaforge-mc1204/src/main/resources/META-INF/mods.toml b/viaforge-mc1204/src/main/resources/META-INF/mods.toml index fc285ca..a10de97 100644 --- a/viaforge-mc1204/src/main/resources/META-INF/mods.toml +++ b/viaforge-mc1204/src/main/resources/META-INF/mods.toml @@ -13,6 +13,4 @@ displayURL="https://github.com/FlorianMichael" logoFile="icon.png" credits="Github contributors" authors="FlorianMichael/EnZaXD" -description=''' - Client-side Implementation of the Via* projects for Minecraft Forge - ''' \ No newline at end of file +description="${description}" \ No newline at end of file