My favorites | Sign in
Project Logo
                
Search
for
Updated Aug 10, 2008 by nawglan
Labels: Phase-Implementation
HowtoBuild  
How to build Java code_swarm in different environments.

Introduction

This guide explains how to setup your development environment to build the binary (ie. jar) version of code_swarm from Java sources.

Setting up the environment

You will need a working Java Runtime Environment the Ant software building tool, and the Java SDK (JDK) from Sun (no idea if other SDK could do the job).

Linux

This guide is written with a Debian based Linux, Ubuntu 8.04. It would requires some minor adaptation to use on other distribution (other packaging systems).

See http://doc.ubuntu-fr.org/java

Windows

This guide as been tested with Windows XP SP3.

Getting the sources

code_swarm sources are under a Google Code Subversion repository (svn). They can simply be browsed by your current web browser, but you would prefer a more dedicated tool to get the full source tree and maintain it up to date.

See Subversion homepage on tigris for all appropriate tools and documents. I would recommend "TortoiseSVN" for Windows users, native "Subversion" package would do for Unix-like users.

See the "Source" tab for further instruction on where to browse and checkout the sources.

Building the sources

Quick build :

Notice that you can type only the second command to do both in once

Alternatively, you can just try the "run.sh" or "run.bat" scripts to get it done in once, but need to rebuild manually typing "ant" if you modify sources

Other commands :

Using Eclipse

Linux users: You must use Sun's java vm. The GNU one doesn't work.

If you don't have Eclipse installed

Ensure you have the SVN interface installed

  • Expand Ganymede and then Collaboration Tools. Select SVN Team Provider.
  • Expand the polarion.org one and then Subversive SVN Connectors. Select SVNKit.
  • Click Install... and Follow prompts from there.

After getting SVN

The green play button should build and launch the app. Enjoy.

See also


Comment by jp.caruana, Jul 10, 2008

why don't you provide a .project file for eclipse users ?

Comment by mariodpros, Jul 22, 2008

On Ubuntu Hardy:

diff --git a/build.xml b/build.xml
index 7f2f82c..3f4f923 100644
--- a/build.xml
+++ b/build.xml
@@ -21,7 +21,7 @@
     <echo>Running BUILD</echo>
     <mkdir dir="${build}" />
     <javac destdir="${build}" srcdir="${src}"
-classpath="${lib}/core.jar;${lib}/xml.jar;${lib}/jogl.jar;${lib}/opengl.jar" debug="true" deprecation="false" />
+classpath="${lib}/core.jar;${lib}/xml.jar;${lib}/jogl.jar;${lib}/opengl.jar;${lib}/vecmath.jar" debug="true" deprecation="false" />
     <copy file="${src}/particle.png" todir="${build}" />
   </target>

No need to install libvecmath1.2-java

Regards

Comment by timosha, Jul 29, 2008
[timon@timon codeswarm-read-only]$ svn diff build.xml 
Index: build.xml
===================================================================
--- build.xml	(revision 226)
+++ build.xml	(working copy)
@@ -21,7 +21,7 @@
     <echo>Running BUILD</echo>
     <mkdir dir="${build}" />
     <javac destdir="${build}" srcdir="${src}"
-classpath="${lib}/core.jar;${lib}/xml.jar;${lib}/jogl.jar;${lib}/opengl.jar;${lib}/vecmath.jar" debug="true" deprecation="false" />
+classpath="${lib}/core.jar;${lib}/xml.jar;${lib}/jogl.jar;${lib}/opengl.jar;${lib}/vecmath.jar" debug="true" deprecation="false" source="1.5" />
     <copy file="${src}/particle.png" todir="${build}" />
   </target>
Comment by tfmorris, Sep 28, 2008

The Eclipse build instructions could be reduced to a couple of steps if the .project and .classpath files were correctly named and in the top level directory instead of off in a subdirectory with the leading dot removed. Since they're hidden files (and there's only two of them), they're really not going to clutter things up for non-Eclipse users.

The Eclipse subdirectory could be used to contain a code_swarm.launch Run configuration to allow people to just pick it from a menu instead of having to configure the sample data file and JVM flags.

Comment by doran...@gmail.com, Jul 09, 2009

In some cases cvs log command may return dates not in format "%Y-%m-%d %H:%M:%S" (as expected by converter), but in format "%Y/%m/%d %H:%M:%S". If it happens converting breaks with something like this:

ValueError: time data '2009/06/16 14:40:22' does not match format '%Y-%m-%d %H:%M:%S'

I've made a little patch for convert_logs.py that should take into account both cases. Save this diff

162c162
<                         date = time.strptime(date_without_plus[0].strip(), '%Y-%m-%d %H:%M:%S')
---
>                         date = time.strptime(date_without_plus[0].strip().replace('/', '-'), '%Y-%m-%d %H:%M:%S')

to file diff.patch and then

patch -n convert_logs.py diff.patch

Everything, of course, should be made in folder where convert_logs.py is located.

Or you may do it by yourself :) What have to be done should be clear from diff.

Comment by madhusudancs, Aug 18, 2009

Hey after I run $ant run, I see a popup for the repo URL, username and passowrd, even though activity.xml already exits in my convert_logs directory. What do I have to do?

Comment by makc.the.great, Dec 01, 2009

having to build this from source is huge turn-off. jdk alone is over 70 megs, and I will not use it for anything else :( check out gource - you can just download win binary and run it out of the box.


Sign in to add a comment
Hosted by Google Code