GanttProject Developer Guide - aDlplibs.adlp.org/ganttproject/developper_guide/ADAE... ·...

18
GanttProject Developer Guide Version 0.4

Transcript of GanttProject Developer Guide - aDlplibs.adlp.org/ganttproject/developper_guide/ADAE... ·...

GanttProject Developer Guide

Version 0.4

CONTENTS

SECTION 1 - INTRODUCTION..................................................................................................................3

1.1 - Purpose of this document...............................................................................................................................................31.2 - TODO............................................................................................................................................................................3

SECTION 2 - JAVA INSTALLATION.............................................................................................................4

2.1 - Java Software Development Kit download........................................................................................................................42.2 - SDK installation on Linux.................................................................................................................................................42.3 - SDK installation on Windows...........................................................................................................................................5

SECTION 3 - ECLIPSE INSTALLATION.........................................................................................................6

3.1 - Eclipse download............................................................................................................................................................63.2 - Eclipse installation on Linux.............................................................................................................................................63.3 - Eclipse installation on Windows.......................................................................................................................................7

SECTION 4 - CREATE A GANTTPROJECT PROJECT WITH ECLIPSE.........................................................................8

4.1 - Create a new project based on sourceforge CVS .............................................................................................................84.2 - View your new eclipse project.......................................................................................................................................124.3 - How to run the software from the project source............................................................................................................15

GanttProject Developer Guide Page 2/18

Section 1 - Introduction

1.1 - PURPOSE OF THIS DOCUMENT

This document describes various useful information of interest to developers who would be interested inworking on GanttProject source code.

1.2 - TODO

Parts still missing from this document are:• How to build a GanttProject executable from source (planned)• How to commit code to SourceForge (planned)• Anything related to Macintosh (any takers ?)

GanttProject Developer Guide Page 3/18

Section 2 - Java installation

2.1 - JAVA SOFTWARE DEVELOPMENT KIT DOWNLOAD

Since GanttProject has been developed in Java, the first thing you have to get is a Java SoftwareDevelopment Kit. There are several Development Kit that Sun provide. The one we advise you to use isthe Java 2 Platform Standard Edition version 1.4.2 (J2SE 1.4.2). There are two things you can get aboutJ2SE 1.4.2 : the Java Runtime Environment (JRE) and the Sofware Development Kit (SDK) which includesJRE.

To develop you need the SDK. It is available for free at : http://java.sun.com/j2se/1.4.2/download.html.

2.2 - SDK INSTALLATION ON LINUX

The following describes how to install the SDK on Linux. If you have downloaded the linux self-extractingfile change to the directory where the file j2sdk-1_4_2_07-linux-i586.bin is.

> sh j2sdk-1_4_2_07-linux-i586.bin

Accept the licence by typing yes when asked.

The SDJ will be extracted into the same directory.

> lsj2sdk1.4.2_07/j2sdk-1_4_2_07-linux-i586.bin

Before starting GanttProject, you have to update your PATH. This can be done by typing the followinglines in your shell:

For Korn-shells (ksh, bash):

> export JAVA_HOME=<path_to_sdk>/j2sdk1.4.2_07/> export PATH=$PATH:$JAVA_HOME/bin/

For C-shells (csh, tcsh):

> setenv JAVA_HOME <path_to_sdk>/j2sdk1.4.2_07/> setenv PATH $PATH:$JAVA_HOME/bin/

Alternately, you can add these lines in your .bashrc file (or equivalent for other shells), so they areexecuted automatically.

Now Java SDK is correctly installed. To check the java type the following :

>java -versionjava version "1.4.2_07"Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b05)Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)

GanttProject Developer Guide Page 4/18

2.3 - SDK INSTALLATION ON WINDOWS

You have downloaded a file named j2sdk-1_4_2_XX-windows-i586-p.exe (where XX is the updateversion). Run this file. Follow the installer to install SDK.

The installation is complete, SDK is correctly installed.

GanttProject Developer Guide Page 5/18

Section 3 - Eclipse installation

You don't NEED to use eclipse in order to work on the GanttProject code. But if you don't know eclipse,you should give it a try, as it's what the GanttProject developers are using, and it's powerful and opensource software.

Prior to installing Eclipse, be sure you have a Java SDK installed.

3.1 - ECLIPSE DOWNLOAD

You can download Eclipse at http://www.eclipse.org/downloads/index.php. Choose the latest stableversion.

3.2 - ECLIPSE INSTALLATION ON LINUX

Installating Eclipse is quite simple : you only have to extract the downloaded archive. For instance, if thearchive is a TAR-GZ archive, type the following :

> tar -xvzf eclipse-SDK-3.1M5a-linux-gtk.tar.gz

It creates a directory in which the Eclipse binary is. To run Eclipse change to eclipse directory and type :

> ./eclipse

GanttProject Developer Guide Page 6/18

3.3 - ECLIPSE INSTALLATION ON WINDOWS

Normally you have downloaded a ZIP archive. Installing Eclipse only consist in decompress this archive. Itcreates a eclipse folder. Change to this folder and run the eclipse.exe file.

That's all !

GanttProject Developer Guide Page 7/18

Section 4 - Create a GanttProject project with eclipse

This section is for user which already have a working installation of eclipse.

All the snapshots are taken on Eclipse Version: 3.1.0.

4.1 - CREATE A NEW PROJECT BASED ON SOURCEFORGE CVS

4.1.1 - Create an eclipse CVS repository view

GanttProject Developer Guide Page 8/18

4.1.2 - Configure CVS repository view

Add new CVS Repository

Add your own user data

GanttProject Developer Guide Page 9/18

It is now possible to browse the CVS repository. The source is in the HEAD -> ganttproject. Therepository, in this case, is the distant repository on SourceForge, so it is not surprising that the browsingis slow.

Of course, as you have used the « anonymous » user name, you may not commit your code to the CVS.

If you wish to be able to commit code, you have to contact the project leader and ask for inclusion ofyour sourceforge login in the project developer's list. When the GanttProject admins have registered yourSourceForge login as a GanttProject developper, you may configure the above differently in order to havewrite (« commit ») permissions:

– Use your SourceForge login and password instead of « anonymous »

– Use connexion type « extssh » instead of « pserver »

GanttProject Developer Guide Page 10/18

4.1.3 - Checkout a local copy of the codeThis is done twice, as you want to get both the « ganttproject » and the« org.ganttproject.impex.msproject ». Otherwise, you would lack the MS-Project import/export feature.

➢ Check Out ganttproject

This is done by right-clicking on the « ganttproject » branch and selecting « Check Out As... »:

This takes some time, depending on you internet access bandwidth.

➢ Check Out org.ganttproject.impex.msproject

This is done in the same way.

GanttProject Developer Guide Page 11/18

4.2 - VIEW YOUR NEW ECLIPSE PROJECT

View it as a java project:

GanttProject Developer Guide Page 12/18

4.2.1 - Add complementary library (if needed)As you may notice in the previous view, some source files appear with a red warning icon. This is due tothe unavailability of the xxxx library (here, mpxj) in the current classpath. This library is called by the fileswhich display the red warning.

Get in « Project » -> « Properties »

In « Libraries » tab, select « Add Jars »

GanttProject Developer Guide Page 13/18

And select the mpxj jar file:

Normally, at this stage, you should not have any errors, only warnings.

GanttProject Developer Guide Page 14/18

4.3 - HOW TO RUN THE SOFTWARE FROM THE PROJECT SOURCE

Get back to the « java » view (you have two projects visible now):

Then « Run »:

GanttProject Developer Guide Page 15/18

Create new eclipse application:

GanttProject Developer Guide Page 16/18

Select « Program to Run »:

In « plug-in » tab, select « choose plug-ins and fragments to launch from list »:

Select both Workspace Plug-Ins and the appropriate External plug-ins:

• org.eclipse.core.runtime

• org.eclipse.core.runtime.compatibility

• org.eclipse.osgi

• org.eclipse.update.configurator

GanttProject Developer Guide Page 17/18

Then you can « apply » and « run »!

- END OF DOCUMENT -

GanttProject Developer Guide Page 18/18