Use recommended approach to applying version data to mdk.

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw 2019-01-27 11:37:56 -05:00
parent e9d087b6f3
commit ae176e6c1f
2 changed files with 12 additions and 19 deletions

View file

@ -78,21 +78,15 @@ dependencies {
} }
processResources { // Example for how to get properties into the manifest for reading by the runtime..
// this will ensure that this task is redone when the versions change. jar {
inputs.property 'version', project.version manifest {
inputs.property 'mcversion', '@MC_VERSION@' attributes(["Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
// replace stuff in mcmod.info, nothing else "Specification-Version": "24.0", // We are version 1 of the modlauncher specification
from(sourceSets.main.resources.srcDirs) { "Implementation-Title": project.name,
include 'META_INF/mods.toml' "Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
// replace version and mcversion "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
expand 'version':project.version, 'mcversion': '@MC_VERSION@'
}
// copy everything else except the mods.toml
from(sourceSets.main.resources.srcDirs) {
exclude 'META_INF/mods.toml'
} }
} }

View file

@ -24,7 +24,7 @@ authors="Love, Cheese and small house plants" #optional
# The modid of the mod # The modid of the mod
modId="examplemod" #mandatory modId="examplemod" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="1.0" #mandatory version="${file.jarVersion}" #mandatory
# A display name for the mod # A display name for the mod
displayName="Example Mod" #mandatory displayName="Example Mod" #mandatory
# The description text for the mod (multi line!) (#mandatory) # The description text for the mod (multi line!) (#mandatory)
@ -35,7 +35,6 @@ Have some lorem ipsum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
''' '''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.examplemod]] #optional [[dependencies.examplemod]] #optional
# the modid of the dependency # the modid of the dependency