> JEsMS
JEsMS
 

Building JEsMS from sources

Introduction and Requirements

Even if Java is inherently multiplatform (and therefore you don't have to recompile sources to make it work on your computer) there are several reasons to build JEsMS directly from sources, for example a user could be interested in making some minor changes to the main sourcecode to experiment new algorithms or maybe he's simply interested in using the last development version that usually is available only in source format.

Anyway, if a JEsMS user is interested in recompiling JEsMS from sources he must install the following software:

  • Java Development Kit (JDK)
    Downloadable from java.sun.com; JDK contains all tools (java compiler, jar builder, etc...) necessary to compile java programs.
  • Apache Ant
    Downloadable from ant.apache.org; Ant is a source building system for Java programs that makes compiling and building large projects very easy, JEsMS can be built without it but... it's free, make yourself a favour and install it.

Having installed all requirements you've to ensure that JDK and Ant are properly configured. Open a command line prompt (a shell under linux or a cmd.exe prompt under windows) and try writing the following line:

ant -version

If you receive an error instead of the reassuring ant version message, refer to JDK and Ant documentation to proper configure them on your platform.

Build JEsMS main program

Building JEsMS main program is particularly easy, move to JEsMS root directory (the one containing build.xml file) and type:

ant build

If all is properly configured ant should compile and build JEsMS sources, at the end of building phase a subdirectory called jars has been created and a new jar file called "JEsMS-<date>.jar" which obviously contains the just-compiled JEsMS program.

Building JEsMS Tools

Exactly as in the previous section, building all auxiliary tools is just matter of typing:

ant buildTools

If all is properly configured ant should compile and build all JEsMS tools except ManagerGUI Applet (that is, Updater, Merger, Teamsheet Creator, Fixture Generator,etc...) placing all tools in a single jar called "JEsMSTools-<date>.jar" always in the same jars directory.

Build JEsMS ManagerGui Applet

Exactly as in the previous sections, building the graphical applet is just matter of typing:

ant buildApplet

If all is properly configured ant should compile and build ManagerGUI Applet generating a jar file called "ManagerGUI-<date>.jar" always in the same jars directory.

Other Ant tasks

To build different sections of JEsMS we used three different Ant "tasks" (build, buildTools and buildApplet), obviously these tasks are not the only described in the build.xml file; here we will list other interesting tasks (you can invoke them just typing "ant <taskname>"):

  • buildAll
    Compile and build both JEsMS main program and other JEsMS tools (except applet) in a single jar called "JEsMSAll-<date>.jar".
  • clean
    Deletes all auxiliary files created by ant to compile and build tasks (this means release and jars subdirectories).
  • buildLeague, buildFixtures, buildTSC, buildMerger, buildLeaders, buildUpdater, buildRosterGenerator
    Compile and build a single, individual tool.
  • compile, compileTools, compileAll,
    compileLeague, compileFixtures, compileTSC, compileMerger, compileLeaders, compileUpdater, compileRosterGenerator

    Similar to corresponding buildXYZ task, these tasks simply compile sources without building the final jar file; all .class files (the output of compilation phase) are placed inside a release subdirectory.
  • compileCore
    Compiles (and not build) all Core JEsMS classes; these classes, contained in the package Engine, are defined to manage generic data structures such as TeamSheets, Rosters, Players etc..., and are used by all JEsMS tools. Developers interested in developing external java tools for JEsMS are strongly encouraged to make use of these classes instead of completely reinventing the wheel in their programs.