Build Phex from Subversion
From PhexWiki
Contents |
Intro
This is a guide for all those, who don't want to wait for the new release of Phex but prefer staying on the cutting edge of development, with all the advantages and drawbacks it includes.
It is also a guide for those who want to try their own tricks with the code or just begin Java-Programming and want to get their fingers dirty on some nicely structured code, where their contributions really count and where they get part of a greater whole (or at least of a program in which their changes form a noticeable part of the whole image). Therefore I'll also include some hints for structuring your code to conform with the structure in Phex.
Getting the source-code from Subversion
To checkout the Phex source code use the command:
svn co https://phex.svn.sourceforge.net/svnroot/phex/phex/trunk phex
Now you are ready to compile the code to get running.
More detailed instructions on how to get the source code can be found in the Subversion instructions document.
Compiling the Code
Phex uses Maven to manage the build process and it's library dependencies. To compile and package Phex execute the maven build lifecylce phase 'package'.
cd $(Phex Folder) mvn package
The compiled classes are now available in the directory: $(Phex Folder)/target/classes The ready to be executed phex.jar file is located at: $(Phex Folder)/target/phex.jar together with its depended libraries.
Run Phex
To run Phex execute from the $(Phex Folder):
java -jar target/phex.jar
Create Documentation
Maven provides the ability to generate various project documentations.
An online version (likely out-of-date) of the Phex Javadoc is also available at: http://www.phex.org/javadoc/phex. It includes links to the Phex source code and offers UML diagrams of packages and classes.
Javadoc
To generate Javadoc API documentation including the UML diagrams use:
mvn javadoc:javadoc
The output is written to: $(Phex Folder)/target/site/apidocs
To draw the UML diagrams the Graphviz library is required. Graphviz can be obtained from : http://www.graphviz.org/
After installing Graphviz, you need to add the 'bin' directory to you PATH environment. It should be enough to do this only for the environment you use to run the Maven process.
As output you will get JavaDoc documentation with integrated Phex source and UML diagrams.
Source cross-reference
To generate a source cross-reference of Phex use:
mvn jxr:jxr
The output is written to $(Phex Folder)/target/site/xref
Folder Structure
Here I'll give a few infos for structuring the code and where to find what.
All source code can be found in the folder "src". It is split into tests (src/test) and working code (src/main).
All Phex-specific Java-code (except the tests) can be found in the folder "src/main/java/". The code written by the Phex-Team is in the folder "src/main/java/phex".
Libraries are in the folder "thirdparty" and native code for different platforms is in the folder "native". Also as top-level folders you find the installer and docs. The folder target" is where you find the compiled results and the class-files.
Structure of src/phex
For the most part, you should be able to guess the structure from the folder-names. As general guideline for your own code, check first, if it fits into the already existing structure. Also
- All GUI-elements and only those should reside in the folder "gui".
- In "common" you can find classes which are used at many places in Phex.
Contributing
We are always happy to welcome new programmers, novizes as well as experts, long-term coders as well as fly-by code-casters (who write readable code, of course :) ).
We'd be especially glad to find contributors who take on one of the tasks from our Wishlist, or who contribute further Ideas.
Should you be more interested in beta-testing Phex, please have a look into our forums.
Also we search for people, who can help localizing Phex to more languages. We already have German, English, Dutch, French and Spanish.
If you want to help localizing, please have a look at out localization-guide. We use a simple text-file with entries which can be translated.


