Jump to content

TOML File question about ${}


American2050

Recommended Posts

So I'm slowly getting back into modding for 1.14.4 and of course, a lot of things have changed and I have many questions for sure and will have even more.

 

This is a simple one to get more information about the TOML file. We can read on it:

 

# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="${file.jarVersion}" #mandatory

 

What are and where can I find the "well known" ${} variables.

 

And what would be the best way to not hardcode that value but be able to read it from one of the .java files in my mod structure?

 

Link to comment
Share on other sites

Is it common that when running from within IntelliJ it just comes as "NONE" I assume it's because we don't have a jar file yet.

 

But on my mods.toml file I have

version="${file.jarVersion}"

 

and on build.gradle I have this

 

version = '1.0'
group = 'mramericanmike.terracottaworld' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'TerracottaWorld'

jar {
    manifest {
        attributes([
            "Specification-Title": "terracottaworld",
            "Specification-Vendor": "mramericanmike",
            "Specification-Version": "1", // We are version 1 of ourselves
            "Implementation-Title": project.name,
            "Implementation-Version": "${version}",
            "Implementation-Vendor" :"mramericanmike",
            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

 

I think it should be good to work like that right? I'm not taking the value from a java file, but at least it will update when I change it for the build.

Link to comment
Share on other sites

I use the processResources block to substitute in my version.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

  • 3 years later...
On 1/6/2020 at 9:25 AM, American2050 said:

 

jar {
    manifest {
        attributes([
            "Specification-Title": "terracottaworld",
            "Specification-Vendor": "mramericanmike",
            "Specification-Version": "1", // We are version 1 of ourselves
            "Implementation-Title": project.name,
            "Implementation-Version": "${version}",
            "Implementation-Vendor" :"mramericanmike",
            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

I think it should be good to work like that right? I'm not taking the value from a java file, but at least it will update when I change it for the build.

Another way to do this without using "${}" is to replace the implementation version with:

"Implementation-Version": project.version,
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.