5.1 - G
ENERALSince GanttProject is a plugin and has plugins, you should export GanttProject as a plugin when you want to deploy it.
Select menu item “File” -> “Export”
Choose “Deployable plug-ins and fragments”
Select all available plug-ins
In the “Export Options” you can choose “a single ZIP file”, “a directory structure” or “individual Jar archives for Update site”. The two first would suit, this example shows the process with “a directory structure”.
As soon as the export is finished, a directory named “plugins” is created with the plug-ins (ganttproject core plus the other plug-ins you have chosen to export).
Now you can test with eclipsito library if GanttProject will run correctly:
copy the eclipsito.jar file at the same level as “plugins” folder you have just created by exporting GanttProject;
copy the ganttproject-eclipsito-config.xml file too;
Now you can run GanttProject using the command:
> java -classpath yourclasspath;eclipsito.jar
org.bardsoftware.eclipsito.Boot eclipsito-sample-config.xml You can also create a script file if you want...
5.2 - B
UILDINGINSTALLERS5.2.1 - Windows Principle
The Windows installer for GanttProject is built with a free software: NSIS. You can find any information about NSIS at http://nsis.sourceforge.net/ and also download its latest release.
The principle is to write a NSIS script file that, once compiled, will produce a windows installer.
You can find a script file named ganttproject.nsi to build a Windows installer for GanttProject in the installer folder at the CVS Head of GanttProject.
How to build the installer
To build the installer you have to compile the ganttproject.nsi script using NSIS. Prior to compile you have to install NSIS on your computer and there are some files to put together in the same folder:
+ doc folder
- COPYING (required)
+ org.ganttproject.chart.pert_1.0.0 + org.ganttproject.impex.htmlpdf_2.0.0 + org.ganttproject.impex.msproject_2.0.0 - eclipsito.jar
- ganttproject-eclipsito-config.xml - ganttproject_16.ico
- ganttproject_32_2.ico
The COPYING, AUTHORS and README files are located at ganttproject root. eclipsito.jar can be found in lib/core. ganttproject-eclipsito-config.xml is located at ganttproject root. The icons files can be found in data/resources/icons. The plugins folder may be built using eclipse as follow:
select ganttproject projects and all plug-ins projects, right-click and choose export from the context menu.
Choose deployable plug-ins and fragments
Select all plug-ins, choose deploy as a directory structure and specify the right destination
In the Windows explorer, you will have all the needed files in the same folder, then right-click ganttproject.nsi file and choose Compile NSIS Script.
After compilation, a exe file will be created, it is the Windows installer for GanttProject!
To get further information about NSIS and NSIS script file format, read the NSIS manual and visit the NSIS Web site (http://nsis.sourceforge.net/).
This way of creating the GanttProject Windows installer will certainly evolute in the future. So keep the developers' guide up to date...
5.2.2 - GNU/Linux RPM package Principle
The simplest way is to be root (one needs to be root later on anyway) and locate the /usr/src/RPM directory (or it may be in another place on your distribution, but it is not important).
Install a working directory of ganttproject (anywhere), check that you can launch GanttProject, and zip it:
zip -r package.zip directory
place the zip file in RPM/SOURCES/
First round of creating the rpm
Then we found a spec file and edited it to pur needs under the name ganttproject.spec in RPM/SPECS [root@PXX-KRISS SPECS]# rpmbuild -ba -v ganttproject.spec
<< TODO: here put the ganttproject file example >>
One gets:
RPM/SRPMS/ganttproject-1.12-alpha_3.src.rpm RPM/RPMS/i586/ganttproject-1.12-alpha_3.i586.rpm
Beware: this executes all scripts from the spec file without registering the package in the rpm database.
Check that ganttproject can be launched by a normal user.
Check that GanntProject rpm works:
# rm -rf /usr/share/ganttproject/
# rm /usr/bin/ganttproject
Now ganttproject can't be launched by a normal user.
# rpm -Uv RPM/RPMS/i586/ganttproject-1.12-alpha_3.i586.rpm Check that ganttproject can be launched by a normal user.
Complete ganttproject.spec with the file list
add /usr/bin/ganttproject in the list of files in the end of ganttproject.spec then
du /usr/share/ganttproject/ >> ganttproject.spec and edit (this is easy if you are familiar with vi)
5.2.3 - GNU/Linux Debian package
5.2.4 - MacOS Principle
The MacOS software package is an archive containing all the files that the software needs and a properties file describing how the software has to be run.
Once the package is suitably configured, a double-click on the file will launch the software.
Package architecture
The file contents could be viewed by right-clicking the file and selecting the “Display package content”
option.
The package is organized as follow :
• GanttProject.app
• Contents
• MacOS
• JavaApplicationStub :Java application launcher
• Resources
• Java : folder containing all the needed file to run the software.
• GanttProject.icns : package icon
• Info.plist : package properties list
• PkgInfo : package ID
Package working
The package launch the Java application through the JavaApplicationStub executable. This program is able to launch a Java program from the package using the options supplied in the properties file Info.plist It is thus enough to suitably configure the Info.plist file and to include all the needed files for the running of the software in the Resources/Java folder.
The info.plist file
The Info.plist file gathers all settings information of the package.
It is possible to easily publish this file thanks to the Property List Editor application.
The settings concerning the Java launcher (JavaApplicationStub) is in the Java branch of the properties.
To define these properties, it is possible to use the environment variable %JAVAROOT which corresponds to the Resources/Java file path.
The following list presents the package properties :
• In /root :
• CFBundleAllowMixedLocalizations Use of several locales
• CFBundleDevelopmentRegion Package language
• CFBundleExecutable File to run being in the MacOS folder
• CFBundleGetInfoString Application full name
• CFBundleIconFile Name of the file containing the icon is the ressources folder
• CFBundleIdentifier Simple software identifier
• CFBundleInfoDictionaryVersion Properties file version
• CFBundleName Application name
• CFBundePackageType Package type (APPL)
• CFBundleSignature Packager identifier or ????
• CFBundleVersion Application version
• In /root/Java :
• Arguments Command line arguments being in the args of the application main method
• JVMVersion Needed JVM version
• MainClass Name of the class containing the main method
• VMOptions JVM options
• In /root/Java/ClassPath :
• 0 Path to add at the first position in the classpath
• 1 Path to add at the second position in the classpath
• n Path to add at the nth position in the classpath
• In /root/Java/Properties :
• apple.laf.useScreenMenuBar Property to pass to Java for displaying the menu bar top of the screen
Resources
The files that are needed to run the software are the Contents/Resources/Java folder into the package.
DMG
Once you have made the app package, you may want to create a dmg file.
Use the disk tools to create a new image which size should be just a little bigger than the app package.
Once the image created, mount the drive and copy the app package into it.
Unmount the drive.
You should have a dmg file in your documents folder by default (if you don't have specified another target when you have created the image).