Skip to content

Commit

Permalink
Pass description into mod files via Gradle as well
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Aug 5, 2024
1 parent 5316e8d commit e832731
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 32 deletions.
30 changes: 17 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]
Expand Down Expand Up @@ -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"
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion viaforge-mc1122/src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions viaforge-mc1165/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
description="${description}"
4 changes: 1 addition & 3 deletions viaforge-mc1171/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
description="${description}"
4 changes: 1 addition & 3 deletions viaforge-mc1182/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
description="${description}"
4 changes: 1 addition & 3 deletions viaforge-mc1192/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
description="${description}"
4 changes: 1 addition & 3 deletions viaforge-mc1194/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
description="${description}"
4 changes: 1 addition & 3 deletions viaforge-mc1204/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
description="${description}"

0 comments on commit e832731

Please sign in to comment.