|
Developing PerformanceMonster
PerformanceMonster is open source, and the release always contains
all source code. You are free to alter, extend, and in other ways
modify PerformanceMonster accoring to the
license rules.
The PerformanceMonster source code is hosted on JavaForge. If you would like to
contribute to the development of PerformanceMonster, the best way is
to register as a developer there, join the PerformanceMonster project,
and check out the source code.
Since it is extremely hard to find any facts on the JavaForge site,
here is a short "how-to".
Joining the project
- Go to the JavaForge web site
and register. This is quite straightforward.
- Log in.
- Click on the "Projects" tab.
- In the "Search for project" field, enter
PerformanceMonster and press "GO".
- Click the "join" link to the left of the displayed
PerformanceMonster project.
Checking out the source
- Install the Eclipse Java IDE if
you don't already have that.
- Install the Subclipse
Eclipse plugin.
- In Eclipse, set up a new Subversion repository: In the "SVN
Repository Exploring" view, create a new repository location. As Url,
enter
http://svn.javaforge.com/svn/PerformanceMonster . As
user name and password, use the details from your JavaForge
account.
- Open the newly created repository location, right-click on
"trunk", choose "Checkout...". Just check out as a project in the
workspace.
Anonymously checking out the source
Same as above, except you need not join the project. Use username
"Anonymous" and password "anon". Checking out the code anonymously is
handy if you just need to look at the code, or if you e.g. want to
run CruiseControl.
Developing
- Install Java 6 (currently available as a beta download).
- In the PerformanceMonster project in Eclipse, configure the Java 6
installation as your JDK: Right-click on the project, choose
"Properties". Click the "Java Compiler" entry, click the hardly
noticeable "Configure..." link in the lower right corner, specify the
new JRE, specify it as default. Back in the "Properties for (project
name)" dialog, click the "Java Build Path" entry, go to the
"Libraries" tab, make sure the "JRE System Library" is taken from the
Java 6 JRE.
- In the Eclipse workbench, double-click on the "values.properties"
file in the top-level directory. Alter the "java6.jdk.home" variable
to point to your new JDK.
- In the Eclipse workbench, select the pull-down menu
"Window->Preferences...". Click "Ant->Runtime", click "Ant home
Entries (Default)". Hit the "Add External JARs" button, point out the
file "(eclipse-home)/plugins/org.junit_3.8.1/junit.jar". Click
"OK".
- In the Eclipse workbench, double-click on the "build.xml" in the
top-level directory. You should now be able to run the various
tasks. Start off with "test". If it fails, find out why. It is
worthless to continue if this task fails!
The targets in the main "build.xml" file should be
self-explanatory.
We really need to describe the coding standards we adhere to, such
as the code formatting and rules for how much unit testing is
mandatory. For now, look at the existing code to get an idea of the
formatting, and use your common sense (and experience!!!) regarding
unit tests.
Committing changes
Let's imagine you implemented a new feature, fixed a bug, or whatever. Now you want to commit your change back into the JavaForge repository.
- Make sure you have automatic tests for your changes, and that
those tests are automatically invoked when invoking the "test" target
in the top-most "build.xml" file.
- Update your repository.
- Make sure that the Ant target "clean" followed by "test" works
with no errors.
- On the web pages for PerformanceMonster on the JavaForge site, you
need a bug report, a change request, a requirement, or a task
describing what you have done. Note the ID of that issue.
- Commit your files like you normally would using Subclipse. As
commit comment, prefix with # followed by the JavaForge issue id. For
example, if you fixed some spelling mistakes described in issue 1571,
a possible commit comment could be "#1571 Fixed Spanish spelling
mistakes".
It's quite cool to have a CruiseControl instance running,
continuously checking for changes in the Subversion repository and
building PerformanceMonster if such changes exist. A complete log for
all builds can be viewed, and for each build, the source code changes
since last build can be seen. Test results can be shown. And so on,
and so on... You want one too, right?
- Download latest release of CruiseControl
(version 2.4.1 is known to work).
- Unpack the CruiseControl ZIP file somewhere. Let's call that place
"(cc-home)".
- Create the directory "(cc-home)/projects/PerformanceMonster".
- Go to "(cc-home)/projects/PerformanceMonster", run the command
svn co
http://Anonymous:anon@svn.javaforge.com/svn/PerformanceMonster/trunk
. (including the last "."!).
- Put this config.xml file directly in
"(cc-home)".
- Start up CruiseControl: Go to "(cc-home)", run
./cruisecontrol.sh .
PerformanceMonster will now be compiled, packaged, and released
everytime somebody commits new stuff to the repository. Go to http://localhost:8080 to get an
overview of the details of the builds.
And now...
Happy coding!!
|