When first building a Xenei project, it is recommended to build the release target. The release
target builds everything, including the API documentation. If this build is successful the environment
and configuration are validated.
Building in Eclipse
If all libraries are defined Eclipse should be able to build the projects. The default Eclipse settings
will cause the projects to be built as they are imported. This may not work correctly until the
properties are adjusted.
NOTE: Xenei projects require the use of Ant and the associated build.xml Ant control file to build
everything correctly. However basic compiles inside Eclipse do work. The build.xml and build.properties
files control the operation of Ant.
To build a project using Ant from within Eclipse right-click on the build.xml in a project's root
directory and select Run Ant.... Choose a target and it should build correctly.
Building from the command-line
If all libraries are installed on the development computer and the Java SDK is setup, then position to
the home (root) directory of each project and run the command:
ant release
Several Ant targets are provided to perform each major step required for a release. These are
summarized in the table below.
Target |
Usage |
compile |
Compiles the code into class files. |
jar |
Compile + create the jar |
zipSrc |
Zip the source and build.support directories. |
javadocs |
Create the API documentation |
docs |
Build the standard documentation |
package |
jar + zipSrc + docs |
release |
All cleans + package and creates the release zips. |
clean |
Cleans build directories |
prepare |
Prepares (creates) build directories |
cleandoc |
Cleans the document directories. |
preparedoc |
Prepares (creates) the document directories. |
cleanrelease |
clean + cleandoc |
preparerelease |
prepare + preparedoc |
variables |
List the variables and their values |
dump |
List the properties. |
preparewar |
Prepares the war directories (not available in all projects) |
war |
preparewar + jar + Create the war file. (not available in all projects) |
war_min |
prepareware + jar + Create a minimal war file used for updates. (not available in all projects)
|
preparewebapp |
Creates the webapp directories (not available in all projects) |
webapp |
preparewebapp + jar + Creates the webapp defaults. (not available in all projects) |
Required Properties
The Xenei build scripts requrie several properties to function correctly. These are usually set in the
build.properties file, however, they can be set on the Ant command line or within the build.xml.
Property Name |
Usage |
product.handle |
The code name for the current product build. This is displayed in the version information. |
deprecation |
The JVM deprecation switch |
build.compiler |
One of the compiler types for the Ant javac task. See Ant documentation for details. |
optimize |
The optimize parameter for the Ant javac task. See Ant documentation for details. |
verbose |
The verbose parameter for the Ant javac task. See Ant documentation for details. |
debug |
The debug parameter for the Ant javac task. See Ant documentation for details. |
jar.files |
A list of non-Java files that should be added to the jar. These are usually property files.
Multiple files should be separated by commas and may be continued by ending the line with a
backslash '\'.
|
relative.dirs |
The list of directories that should be included in the source tree. Must include the .
directory if the current code is to be compiled. It is usually used to include code outside of
the source tree into the compile, for example when merging code into a new project.
|
Name |
The formal name of the application. This value may include spaces and should be mixed case as
appropriate. It is displayed in the version information.
|
name |
The name of the application as it appears in file names. Should be lowercase without spaces,
slashes, backslashes, colons or other characters not normally allowed in file names.
|
version.number |
The version number of the product being built. |
doc.packages |
The package names that should be included in the documentation. Value may include a wildcard
(e.g. org.xenei.util.*). This option is most often used in conjunction with the relative.dirs
parameter.
|
lib.environment |
A list of libraries that are expected to be in the environment (e.g. imago.jar for imago
extension code, or servlet.jar for the imago code). Jars listed in this parameter are required
and used for compilation but are never included in the release packages.
|
lib.external |
A list of 3
rd-party libraries that are required to for the build.
|
lib.internal |
A list of Xenei libraries that are required for the build. |
package.dirs |
A single directory. This should match the shortest package name provided by the application
(e.g. org/xenei/imago). It is primarily used to located classes, source files, and to create
the version information property file.
|
source.package |
This should be the shortest package name provided by the application (e.g. org.xenei.imago)
|
Optional Properties
The Xenei build scripts allow for several optional properties. These may be set in the build.xml,
build.properties, or on the command line when Ant is started.
Property Name |
Default Value |
Usage |
main.class |
none |
Defines the default class in the resulting jar file. |
webapp.name |
name property value |
Defines the application name in the servlet container webapps directory. This is most often
used when building extensions for other applications (e.g. imagoX)
|
warfile.name |
webapp.name property value. |
Defines the name of the war file. |
run.dir |
XENEI_ROOT/webapps |
Defines where to build the webapp target. This is most often used to force the build to replace
and existing webapp installation.
|
product.dir |
name property value |
Defines the directory name for this project. The directory is located immediately under the
XENEI_ROOT directory.
|
relative.dirs |
. |
The list of directories that should be included in the source tree. Must include the .
directory if the current code is to be compiled. It is usually used to include code outside of
the source tree into the compile, for example when merging code into a new project.
|
class.dir |
XENEI_ROOT/product.dir/bin |
Defines the directory that the class files will be built in. |
lib.dir |
XENEI_ROOT/lib |
Defines the directory where the external libraries can be found and where the build process
will place the jars that are created.
|
lib.min.int |
none |
The internal libraries that must be included in a minimal release. |
lib.min.ext |
none |
The external libraries that must be included in a minimal release. |
All trademarks and copyrights are the property of their respective owners.
Copyright © 2002-2004 by Xenei.com, All Rights Reserved