Getting started programming Alliance
Introduction
This short guide will help you set up a development environment for Alliance. Once you are done with this guide you will be able to make changes in the Alliance code, compile them and test them using the Alliance testsuite.
Get the source code using SVN
The steps below are for Windows XP users. If you run another OS look here.
- If you haven't got TortoiseSVN installed download it here: http://tortoisesvn.net/downloads. It's the best SVN client for Windows.
- Create a project directory for alliance. I call mine... alliance
- In this directory, using windows explorer, right-click och the background and select "SVN Checkout"
- As "URL of repository" enter: https://alliancep2p.svn.sourceforge.net/svnroot/alliancep2p
- Click OK. All files will be downloaded from SVN repository now.
- Create a directory called classes. All Java classes will go here.
Compile Alliance
- Alliance uses JUnit. Download JUnit here: http://sourceforge.net/project/showfiles.php?group_id=15278
- The make.xml in the root is NOT used to compile Alliance. It's used to generate a new release of alliance. You need to manually compile all files in the src/ directory. The following must be in your classpath while compiling:
- All files in the lib/ directory of alliance (this was downloaded from SVN)
- The JUnit jar you downloaded in step one. In my case this file was called junit-4.1.jar.
Put all freshly compliled classes in the classes/ directory.
Generate TestSuite
- Create a directory called c:\share (this path is defined in
org.alliance.misc.GenerateTestSuite.SHARE_DIRECTORY )
- Throw in a bunch of files there. Every test user in your testsuite will share a subset of the files in this directory. Make sure you have at least five directories in c:\share and that these five directories contain a bunch of files each.
- With the Alliance project directory as your current directory run:
java -cp <path to all jar files needed> org.alliance.misc.GenerateTestSuite
<path to all jar files needed> are the same jar-files as in 'Compile Alliance' - that's all files in the lib/ directory and the JUnit jar.
The testsuite will now be generated - what actually happens is that a number of alliance setting files are generated in
the testsuite/settings directory.
Run TestSuite
- With the Alliance project directory as your current directory run:
java -cp <path to all jar files needed> -Dtestsuite=true org.alliance.launchers.testsuite.Main
<path to all jar files needed> are the same jar-files as in 'Compile Alliance' - that's all files in the lib/ directory and the JUnit jar.
- Wait. The first time you start the testsuite all test users hash all their shared files at the same time.
- Once all the hashing is done you can try starting the UI for a user by double-clicking on the username in the testsuite UI.
You are now ready to start hacking with Alliance!
If you need more information have a look at the technical documentation or the developer forum.
You may also take a look at the guide describing how to set
up Netbeans to compile Alliance.
|