Building MARS With Ant
From Multiverse
| MARS |
|
Building MARS With Ant |
| Mob Server |
| Object Manager |
| Combat Server |
|
Abilities and Combat Plugin • Combat Statistics • Extending the MARS Combat System • Group System • Trainer Plug-in • Professions • Experience System |
| Tutorials |
| Other Examples |
|
Triggering an Action with a Mouseclick • Scheduled Execution • Working with Sound • Creating a Teleporter |
Overview
The most straightforward way to build MARS is to use Ant, the open source Apache build tool. Although it is highly recommended to use an IDE such as Eclipse or NetBeans as your development environment, you can also use Ant along with a decent text editor. For more information on using an IDE, see Setting Up a Development Environment.
General procedure
This procedure will work on either Linux or Windows, but the following procedure uses Windows with Cygwin.
Follow these steps:
- Download Ant.
- Extract the zip file to c:\, which will create a directory
c:\apache-ant-versioncontaining all the Ant files, where version is the version of Ant you downloaded, for example,C:\apache-ant-1.7.0. - Edit your .bashrc file and add the following lines
export ANT_HOME=c:/apache-ant-1.7.0 export PATH=${PATH}:${ANT_HOME}/bin -
Re-execute your .bashrc by typing:
source ~/.bashrc
-
Backup your existing
mars.jarfile, in case you ever want to go back to the "original." This is optional, but highly recommended:cp dist/lib/mars.jar dist/lib/mars-backup.jar
-
Make sure your servers are not running, then enter this command (still in the top level Multiverse directory, MV_HOME):
ant -f build_mars.xml -lib ./dist/lib
The
-foption tells ant to use the build filemars_build.xml. The-liboption tells it to look in the Multiverse distribution library folder for additional jar files that may be needed during the build.This script will initially create an
MV_HOME/builddirectory to contain the compiled Java class files. Thenceforth, it will simply rebuild these class files. Then, it will put all the MARS class files into a JAR (Java archive) file,mars.jar(in theMV_HOME/dist/libdirectory).
Now, start the servers as you normally do; the servers will use your version of MARS, instead of the original. If you ever want to revert to the original, simply rename mars-backup.jar back to mars.jar.
Categories: MARS | Server
