Ant How To For building SMEE packages - Pfhoenix/Starbound-Mass-Effect-Edition GitHub Wiki
About Ant
Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications.
But Ant can easily used to build and deploy any kind of software, even for building a Starbound mod.
Setting up Ant in Eclipse
First if you haven't download a Eclipse distribution: http://www.eclipse.org/downloads/ Good thing besides using it for Ant is, there are also plugins for JSON and LUA.
Setup a new empty Projekt named "Starbound-Mass-Effect-Edition". Copy your contents of your Starbound-Mass-Effect-Edition folder in this new one (also .git).
In the ant folder copy build.properties.sample to build.properties
If you use another project folder name as Starbound-Mass-Effect-Edition then you will need to change these lines, too:
inside buildSMEE.xml
<loadproperties srcfile="Starbound-Mass-Effect-Edition/ant/build.properties"/>
inside build.properties
dir.project=${basedir}\\Starbound-Mass-Effect-Edition\\
Also you will need to adjust dir.sbassetpacker to the installation folder where the Starbound asset packer exe is located (absolute path)
Hit F5 to refresh your project. You now see all SMEE files in your Package Explorer.
Now click on "External Tools" the green play button with the suitcase in the icon bar. Click on External Tool configuration. Create a new launch configuration.
In the main tab add:
Buildfile: ${workspace_loc:/Starbound-Mass-Effect-Edition/ant/buildSMEE.xml}
Base Directory: ${workspace_loc}
In the JRE tab you may have to adjust the jre path. This happens if you have installed more than one Java runtime parallel. Like me, I installed 64 and 32 bit parralel. If you only have one Java Runtime, you can skip this.
If you now open the "External Tools" with the black arrow again something like, "Starbound-Mass-Effect-Edition buildSMEE.xml" should appear. By clicking on it, the build process is started.
Folders Overview
Inside the ant folder there is a sub-folder "template" where all data is organized:
- SMEE root
- ant
- ant-contrib (external ant libs)
- templates
- optional
- SMEE
- optional
- SMEE
- SMEEtest
- release (created by build script not tracked with git)
- ant
"ant" folder
- build.properties - configuration file for buildSMEE.xml
- buildSMEE.xml - ant build script.
"templates" folder
- lastchanges.txt - list with the last changes.
Building SMEE
What happens if I start a build
All files inside the template folder contain wildcards, e.g. @MOD_VERSION or @SB_VERSION. These template files are copied to thier appropriate into the SMEE and optional folder of our SMEE root folder (see above).
After coping the Wildcards are replaced, so inside our SMEE and optional root folder there are always functional .modinfos, etc., and if we decide to abbandon ant, we just need to remove the ant folder from our project and everything is fine.
After the root folders are updated, the SMEE files are packed into SMEECore.zip and the optional files are packed into SMEEoptional.zip These 2 files can now uploaded. DONE.
Updating the Version
Open build.properties:
project.name.short=SMEE
project.name.long=Starbound : Mass Effect Edition
# update mod version here
project.version=0.1.1
# update starbound version here
starbound.version=Beta v. Furious Koala
# setup your workspace and sub dirs.
# @param basedir is exclipse workspace dir (automatic aquired form eclipse)
# if your eclipse project folder for SMEE is not "Starbound-Mass-Effect-Edition"
# you have to replace it with your name.
dir.project=${basedir}\\Starbound-Mass-Effect-Edition\\
# setting up folder, nothing needs to be changed here
dir.smee.src=${dir.project}SMEE\\
dir.optional.src=${dir.project}optional\\
dir.release=${dir.project}release\\
dir.ant=${dir.project}ant\\
dir.templates=${dir.project}ant\\templates\\
# csv list with our optional mod names.
optional.modlist=SMEEapex,SMEEavian,SMEEfloran,SMEEglitch,SMEEhylotl
Now change the entries for project.version and starbound.version. Save and done. The next build will use the new version.
Updating the Readme
Both in the SMEE folder and the optional folder are Readme.txt files if you want to change anything. You can do it here.
Updating the Changelog
Inside the templates folder you will find lastchanges.txt. As long as we work on an new release, you can add the changes you made here.
When building a new package you'll get asked if you want to: "Save Changlog history changes?"
So what does it mean? If you choose y(es) the current entries from lastchanges.txt are permanently copied into changelogHistory.txt. The n(o) option is for dry runs if you want to make a test release.
Adding a new optional mod
TODO