Java Installation and Build Process of VisualDCT | |
---|---|
Project: | VisualDCT-Common |
Classification: | User's Documentation |
Identification: | CSL-DOC-02-000042 |
Copyright © 2002 by Cosylab Ltd. All Rights Reserved. |
Revision | Date | Author | Section | Modification |
---|---|---|---|---|
1.0 | 2002-07-02 | Matej Sekoranja | ||
all | Created. | |||
1.1 | 2002-07-09 | Matej Sekoranja | ||
4. | Updated. | |||
1.1 | 2002-07-10 | Matej Sekoranja | Released | |
1.2 | 2005-08-21 | Matej Sekoranja | ||
4. | Updated. | |||
1.2 | 2005-08-21 | Matej Sekoranja | Released |
This document is classified as a public document. Redistribution and use, with or without modification, are permitted provided that:
ID | Author | Reference | Revision | Date | Publisher |
---|---|---|---|---|---|
1 | Gasper Tkacik | Java Installation and Build Process HowTo | 1.2 | 2002 | Cosylab |
2 | IBM Corporation and others | Eclipse Project | 2.0 | 2002 | IBM Corporation and others |
3 | Jakarta ANT Team | ANT Homepage | 1.4.1 | 2001 | Apache Software Foundation |
4 | GPL | JUnit Testing Framework | 3.7 | 2002 | Sourceforge.net |
5 | Langdale | Styler ANT Task | 1.0 | 2002 | Langdale |
6 | GPL | MySQL JDBC driver | 2.0.11 | 2002 | Sourceforge.net |
This document's meta-information (authors, revision history, table of contents, ...) can be found above. What follows below is the body of the document. The body is composed of several sections, which may be further composed of subsections.
Typographical styles are used to denote entities of different kinds.
When viewing the document in a non-printed form, it is possible to submit comments regarding a given section to the document's owner. This is achieved by clicking the mail icon next to the section title. For this to work, your mail must be configured to properly handle the mailto URLs.
This document is divided into three sections. The first section defines the locations of the 3rd party software, such as Sun runtime libraries, extension libraries etc. The second section describes the Eclipse (or Websphere) installation and setup. The third section describes the use of Ant build files, which are customarily distributed with the VisualDCT project.
Third party software for Java is needed for two distinct purposes:
Apart from this division based on the use of the 3rd party software, it can also be divided into platform-independent and platform-specific. Libraries delivered in jar form together with their documentation and resources form the platform-independent software. Executables, such as run-time environments and stand-alone services are usually platform-dependent.
The 3rd part software is located in VDCTROOT/3rdParty directory. All 3rd party software, discussed in this section, is then installed into 3rdParty subdirectory in the following manner:
Platform name is defined by the returned value of uname POSIX command.
Under each directory enumerated above, each 3rd party product is installed into its own directory.
The name of the directory is a lower-case product name, followed by a '-' character, followed by a version specification in which dot '.' servers as major / minor separator (e.g. mmmysql-2.0.11).
Every 3rd party product has to have the following directory structure (created if necessary):
3rd party directory structure is used in build files and batches for running programs.
This section lists the steps needed to install Eclipse product and get it working with VisualDCT project. This section presupposes that Java Development Kit has already been installed.
VisualDCT project is built with Ant build tool. Ant tool is used because it is easier to manage than makefiles and it is customized for use with Java (classpath handling, additional build tasks specified in Java, etc). Ant works by executing an Ant build file in the form of Ant conformant XML.
During the development process VisualDCT is build automatically by Eclipse without Ant, this way is easier and faster. All other tasks such as test process, integration builds and releases should be done with Ant.
This section lists the steps needed to configure Eclipse product to build internal VisualDCT-Common project.
[Matej Sekoranja] This is not necessary, since all these kind of settings are stored in .classpath file.
[Matej Sekoranja] In Eclipse - - - add external task jars in classpath.
[Matej Sekoranja]
Ant may give the following error message:
"Cannot use classic compiler, as it is not available. A common solution is to set the environment variable JAVA_HOME to your JDK directory."
To avoid this problem go to - - - and add tools.jar
or
run the Ant script with argument -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter tu run Ant with Eclipse's JRE.
This section lists the steps needed to install Ant product and get it working with VisualDCT project. This section presupposes that Java Development Kit has already been installed.
VisualDCT Ant build scripts need the following external task libraries:
All necessary libraries are located in 3rdparty directory.
In order to build the VisualDCT project manually, the developer responsible for the project must write the build.xml file and place it in the root directory of the project. This file must:
For more insight, a sample build.xml file is provided below.
<project name="VisualDCT sample build example" default="all" basedir="."> <property name="project.name" value="${ant.project.name}"/> <property name="test.class" value="com.cosylab.vdct.sample.test.AllTests"/> <property name="javadoc.packages" value="com.cosylab.vdct.sample"/> <path id="build.classpath"> <pathelement location="./3rdParty/Common/infobus1.2/infobus.jar"/> <pathelement location="./3rdParty/Common/jnlp1.0.1/jnlp.jar"/> </path> <property name="build.classpath.ext" refid="build.classpath"/> <target name="release"> <ant antfile="VDCTBuild.xml" dir="." target="release"/> </target> <target name="build"> <ant antfile="VDCTBuild.xml" dir="." target="build"/> </target> <target name="all"> <ant antfile="VDCTBuild.xml" dir="." target="all"/> </target> <target name="jar"> <ant antfile="VDCTBuild.xml" dir="." target="jar"/> </target> <target name="doc"> <ant antfile="VDCTBuild.xml" dir="." target="doc"/> </target> </project>
Here we provide a brief discussion of the sample build file:
VisualDCT Ant build script VDCTBuild.xml has auto-versioning capability. Script searches for the past builds thourch the directory structure and returns build version. If build or release target is used, it generates a new version, otherwise the latest is used. This feature can be also overriden by setting build.version property as described in Build Parameters section.
Version is composed of major, minor and build version. All three components are numbers and are seperated by a dot '.', e.g. 2.0.1232.
Also filenames follows the
The only exception is a binary file, which is composed of
In order for the build process to work correctly, two parameters must be provided to the JVM or ANT using the -D parameter passing mechanism.
For example, if target directory is ~/dist and version 2.0.1232, the parameters for the JVM look like this:
-Dbuild.output=~/dist -Dbuild.version=2.0.1232
Parameters can be also provided by hardcoding it into build.xml file simply by adding lines:
<property name="build.output" value="~/dist"/> <property name="build.version" value="2.0.1232"/>
VisualDCT Ant build script VDCTBuild.xml has defined the following targets:
[Matej Sekoranja] * - to be used only by Cosylab.
Simply go to the VisualDCT source root directory and type ant.
You do not need any additional (external) libraries.
This document will probably change in the future. When known, the explicit WWW locations will be included.