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 {
// this will ensure that this task is redone when the versions change.
inputs.property 'version', project.version
inputs.property 'mcversion', '@MC_VERSION@'
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'META_INF/mods.toml'
// replace version and mcversion
expand 'version':project.version, 'mcversion': '@MC_VERSION@'
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes(["Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "24.0", // We are version 1 of the modlauncher specification
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
}
// 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
modId="examplemod" #mandatory
# 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
displayName="Example Mod" #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.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.examplemod]] #optional
# the modid of the dependency