Jump to content

[1.6.4] [SOLVED] Jenkins and appending the Build Number to Version Number


Recommended Posts

Posted

I am working on a mod with some buddies of mine and I want to make it so whenever Jenkins builds our mod, it appends the build number to the version number (so "0.0.1" because "0.0.1.103"). This would make it so we do not have to manually increment it everytime we commit.

 

From my understanding of Java (I am a C++/Python guy myself), everything has to be in a class. It cannot run unless it is in a class. Also, the entry point for the mod is the base mod file. It is the first thing that runs. So nothing in out mod can run before it. Also, the version number has to be a constant (final). Therefore, as far as I know, there is no way to programmically set the version number with out a fancy bash script that did a find and replace.

 

I was wondering if anyone knows how to append the build number automatically to the version number or knows how to write the bashscript to do it automatically off the top of their head (I hate writing bash scripts).

 

EDIT: I figured it out. Use you can use an "mcmod.info" file and do a sed to replace a placeholder text with the build number.

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.

Announcements



×
×
  • Create New...

Important Information

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