Table of Contents
-
Ant description
-
OpenCCM available targets
-
Build process structure
-
File structure
-
Build process structure
-
OpenCCM available tasks
-
List of tasks
-
Cleaning CORBA files
-
Checking Java files
-
Generating Java empty interfaces
-
Generating JAR archives from a package
-
Merging multiple archives into a single one
-
Compiling an OMG IDL2 file
-
Generating an XML parser from a DTD file
-
Compiling an XML parser
-
Using the launcher from Ant
-
Starting the OpenCCM Interface Repository
-
Feeding an OMG IDL 3.0 file into the OpenCCM Interface Repository
-
Generating equivalent OMG IDL 2.4 mapping from the OpenCCM Interface Repository
-
Generating the Java OpenCCM skeletons from the OpenCCM Interface Repository
-
Generating all the Java implementation templates from the OpenCCM Interface Repository
-
Compiling an OMG CIDL file and generating associated files
-
Generates all Java OpenCCM templates associated to a CIDL file for the CIF
-
Compiles an OMG PSDL file and generates associated Java mapping
-
Stopping the OpenCCM Interface Repository
-
How to integrate a piece of code?
-
Integrating source code into an existing package
-
Integrating source code into a new package
-
Defining a new module
Ant description
Apache Ant is a
Java-based build tool. In theory, it is kind of like make,
without make's wrinkles.
Makefiles are inherently evil as well. Anybody who has worked
on them for any time has run into the dreaded tab problem. "Is
my command not executing because I have a space in front of my
tab?!!". Tools like Jam took care of this to a great degree, but
still have yet another format to use and remember.
Ant is different. Instead of a model where it is extended with
shell-based commands, Ant is extended using Java
classes. Instead of writing shell commands, the configuration
files are XML-based, calling out a target tree where various
tasks get executed. Each task is run by an object that
implements a particular Task interface.
Granted, this removes some of the expressive power that is
inherent in being able to construct a shell command such as
`find . -name foo -exec rm {}`, but it gives you the ability
to be cross-platform - to work anywhere and everywhere. And
hey, if you really need to execute a shell command, Ant has an
<exec> task that allows different commands to be
executed based on the OS it is executing on.
OpenCCM available targets
Currently, OpenCCM supports the following main targets:
Target
|
Description
|
build |
Build the OpenCCM platform in the <build.dir>
directory.
|
clean |
Clean all the OpenCCM platform.
|
clean0 |
Clean backup files.
|
clean1 |
Reset the demonstrations.
|
clean2 |
Clean compiled JARs.
|
clean3 |
Clean compiled libraries.
|
clean4 |
Clean compiled classes.
|
clean5 |
Clean generated classes.
|
compile |
Compile the OpenCCM platform.
|
doxygen |
Generate Doxygen documentation (IDL & Java) in the
<build.doc.dir> directory.
|
idl |
Compile IDL/DTD files.
|
install |
Install the OpenCCM platform into the <install.dir>
directory.
|
javadoc |
Generate Javadoc documentation in the
<build.doc.dir> directory.
|
parserdoc |
Generate the JJDocumentation for OMG IDL/PSDL/CIDL
parser.
|
release |
Create a release archive of the OpenCCM platform.
|
uninstall |
Uninstall the OpenCCM platform from the <install.dir>
directory.
|
unrelease |
Delete the previously generated release.
|
website |
Generate the OpenCCM website in the <web.dist.dir>
directory.
|
Build process structure
File structure
The build process is composed of the files which are stored
in the <OpenCCM directory>/src/ant directory.
The process is splitted into as modules as files described
below:
File Name
|
Description
|
build.xml |
Main file of the compilation process.
|
common.xml |
Common tasks which are not related to a particular module.
|
corba.xml |
Tasks related to the CORBA 2.x compilation.
|
demo.xml |
Tasks related to the generation of OpenCCM demonstrations.
|
deployment.xml |
Tasks related to the compilation of Deployment/Packaging
tools & OpenCCM deployment infrastructure.
|
documentation.xml |
Tasks related to the generation of OpenCCM documentation
(Javadoc, Doxygen, Website).
|
envi.bin.xml |
Tasks related to the execution of the OpenCCM Production Chain tools
(e.g. ir3_start , ir3_stop , ir3_feed , etc).
|
externals.xml |
Tasks related to the copy of external libraries
(Jidlscript, Xerces, Ant, ...).
|
generator.xml |
Sub-tasks related to the compilation of OpenCCM
generators (IDL3, IDL2, CIF, PSDL, ...).
|
hfinder.xml |
Tasks related to the compilation of the HomeFinder component.
|
install.xml |
Tasks related to the installation & release of OpenCCM
distribution.
|
platform.xml |
Tasks related to the compilation chain of OpenCCM
(Generator, Compiler, Parser, ...).
|
plugins.xml |
Tasks related to the compilation of OpenCCM plugins
(transaction, log, ...).
|
runtime.xml |
Tasks related to the compilation of OpenCCM runtime
(Components, Container, ...).
|
script.xml |
Tasks related to the generation of OpenCCM execution
scripts.
|
services.xml |
Tasks related to the compilation of OpenCCM services
(persistence, ...).
|
task.xml |
Tasks related to the definition of OpenCCM compilation
tasks.
|
umlrepos.xml |
Tasks related to the generation and compilation of UML utilities.
|
utils.xml |
Tasks related to the compilation of OpenCCM utilities.
|
Each XML file is associated to a property file which contains
the definition of properties required for the OpenCCM build
process.
The build.user file contains the template for
build.properties file which would be completed
by OpenCCM users.
Build process structure
The build process has been divided into modules and
callbacks. Modules group packages related to the same domain.
Callbacks are specific entry points which are defined and
called by the main build.xml file during the compilation
process. The existing callbacks are:
Callback
|
Description
|
<module>_init |
Configure the build process of the module.
|
<module>_check |
Check if specific files (DTD, IDL, ...) need to be generated again
during the <module>_generate callback.
|
<module>_generate |
Generate specific files (DTD, IDL, ...) of the module before the
compilation process.
|
<module>_compile_api |
Compile the interfaces (API) of the module.
|
<module>_compile_lib |
Compile the libraries of the module.
|
<module>_build |
Merge all JAR files produced during the compilation of the module
into a single JAR file.
|
The definition of callbacks is quite stable, so please don't
define other terms and use these callbacks in priority.
OpenCCM available tasks
List of tasks
check_windows_os |
Determinates is the current operating system is a Windows
operating system. If it is the case, this task sets the
isWindowsOs property.
|
check_unix_os |
Determinates is the current operating system is a Unix
operating system. If it is the case, this task sets the
isUnixOs property.
|
cpp |
Determines if a user defined C preprocessor is used during
the compilation process and set the appropriate cpp-path
property.
|
task_clean_corba_unused
|
Deletes Helper, Holder, Stubs, POA and POATie generated
Java files keeping only OMG CORBA 2.4 interfaces.
|
task_java_available
|
Determines if a Java file is available or not. If
this file is available, the file-generated
property is set.
|
task_java_gen
|
Generates an empty interface template of a specified file.
|
task_package
|
Compiles and creates elementary archive of a set of packages.
|
task_package_merge
|
Merges a set of archives into a single archive.
|
task_idl2java
|
Compiles an IDL file and generates the related Java
source files (interfaces, stubs and skeletons).
|
task_dtd2java
|
Compiles a DTD file and generates the associated XML
parser.
|
task_dtd_compile
|
Compiles the parser generated from the task_dtd2java
task.
|
task_launcher
|
Starts a new launcher process.
|
task_IR3_start
|
Starts the OpenCCM Interface Repository.
|
task_IR3_feed
|
Feeds the OpenCCM Interface Repository with an OMG IDL 3.0 file.
|
task_IR3_IDL2
|
Generates equivalent OMG IDL 2.4 mapping from the OpenCCM Interface Repository.
|
task_IR3_java
|
Generates the Java OpenCCM skeletons from the OpenCCM Interface Repository.
|
task_IR3_jimpl
|
Generates all the Java implementation templates from the OpenCCM Interface Repository.
|
task_CIDL_CIF
|
Compiles an OMG CIDL file and generates associated files.
|
task_CIF_jimpl
|
Generates all Java OpenCCM templates
associated to a CIDL file for the CIF.
|
task_PSDL_JAVA
|
Compiles an OMG PSDL file and generates
associated Java mapping.
|
task_XMI2IR
|
Feeds the OpenCCM Interface Repository with an XMI 1.1 UML 1.4 document.
|
task_IR3_stop
|
Stops the OpenCCM Interface Repository.
|
task_mof_start
|
Starts the MOF Repository.
|
task_mof_stop
|
Stops the MOF Repository.
|
Cleaning CORBA files
The task_clean_corba_unused task supports the following arguments:
Argument | Description | Required |
directory | The root directory containing the files to clean. | Yes |
Checking Java files
The task_java_available task supports the following arguments:
Argument | Description | Required |
build.gen.dir | The root directory for looking for the file. | No |
dir | Path to the file to find. | Yes |
name | Name of the file to check. | Yes |
Generating Java empty interfaces
The task_java_gen task supports the following arguments:
Argument | Description | Required |
build.gen.dir | The root directory for looking for the file. | No |
dir | Path to the file to create. | Yes |
package | Package of the generated file. | Yes |
name | Name of the file to create. | Yes |
Generating JAR archives from a package
The task_package task supports the following arguments:
Argument | Description | Required |
source | List of root directories containing the files to compile (separated by :). | Yes |
package | List of packages to compile (separated by ,). | Yes |
delete | List of files to delete before creating the archive (separated by ,). | No |
archive | Name of the archive to create with the compiled files. | Yes |
Merging multiple archives into a single one
The task_package_merge task supports the following arguments:
Argument | Description | Required |
archive | The name of the final archive. | Yes |
externals | List of archives of the externals directory to merge. | No |
libraries | List of archives of the lib directory to merge. | Yes |
Compiling an OMG IDL2 file
The task_idl2java task supports the following arguments:
Argument | Description | Required |
file | The name of the OMG IDL file to compile. | Yes |
autopkgflag | Specific flag for using auto-package option during compilation process. | No |
destdir | Directory where generated files will be stored. | No |
flags | ORB OMG IDL compiler specific flags. | No |
Generating an XML parser from a DTD file
The task_dtd2java task supports the following arguments:
Argument | Description | Required |
constraints.file | The name of the DTD file to compile. | Yes |
root.element | The root element of the DTD to consider. | Yes |
xml.dtd.javapackage | The mapping of the root element to the associated package. | Yes |
xml.dtd.interfacespackage | The package name for the generated interfaces. | Yes |
Compiling an XML parser
The task_dtd_compile task supports the following arguments:
Argument | Description | Required |
root.element | The root element of the DTD to consider. | Yes |
xml_dtd.descriptors_source.dir | The root package to compile. | Yes |
Using the launcher from Ant
The task_launcher task supports the following arguments:
Argument | Description | Required |
arguments | Command-line arguments for the launcher and the application. | Yes |
xml | The XML file with configuration for the application to launch. | Yes |
Starting the OpenCCM Interface Repository
The task_IR3_start task supports the following arguments:
Argument | Description | Required |
extra.arguments | Any extra arguments. | No |
Feeding an OMG IDL 3.0 file into the OpenCCM Interface Repository
The task_IR3_feed task supports the following arguments:
Argument | Description | Required |
idl3 | The OMG IDL 3.0 file to feed into the Interface Repository. | Yes |
extra.arguments | Any extra arguments. | No |
Generating equivalent OMG IDL 2.4 mapping from the OpenCCM Interface Repository
The task_IR3_IDL2 task supports the following arguments:
Argument | Description | Required |
scope | The OpenCCM Interface Repository object which should be mapped to OMG IDL 2.4. | Yes |
idl2 | The name of the OMG IDL 2.4 output file. | No |
extra.arguments | Any extra arguments, e.g. -i system_file -ipath user_file . | No |
Generating the Java OpenCCM skeletons from the OpenCCM Interface Repository
The task_IR3_java task supports the following arguments:
Argument | Description | Required |
scope | The OpenCCM Interface Repository object which should be mapped to Java OpenCCM skeletons. | Yes |
directory | The directory where the skeletons should be generated. | Yes |
extra.arguments | Any extra arguments. | No |
Generating all the Java implementation templates from the OpenCCM Interface Repository
The task_IR3_jimpl task supports the following arguments:
Argument | Description | Required |
scope | The OpenCCM Interface Repository object which should be mapped to Java implementation templates. | Yes |
extra.arguments | Any extra arguments. | No |
Compiling an OMG CIDL file and generating associated files
The task_CIDL_CIF task supports the following arguments:
Argument | Description | Required |
cidl | The name of the OMG CIDL file to compile. | Yes |
include | Add a #include "file" statement where file must be the complete file path. | No |
directory | Generate Java implementations into directory. | No |
cif | Set the output file name. | No |
extra.arguments | Any extra arguments. | No |
Generates all Java OpenCCM templates associated to a CIDL file for the CIF
The task_CIF_jimpl task supports the following arguments:
Argument | Description | Required |
cidl | The name of the OMG CIDL file to compile. | Yes |
directory | Generate Java implementations templates into directory. | No |
extra.arguments | Any extra arguments. | No |
Compiles an OMG PSDL file and generates associated Java mapping
The task_PSDL_JAVA task supports the following arguments:
Argument | Description | Required |
psdl | The name of the OMG PSDL file to compile. | Yes |
directory | Generate Java implementations mapping into directory. | No |
extra.arguments | Any extra arguments. | No |
Feeding an XMI 1.1 UML 1.4 document into the OpenCCM Interface Repository
The task_XMI2IR task supports the following arguments:
Argument | Description | Required |
xmi | The XMI 1.1 UML 1.4 document to feed into the Interface Repository. | Yes |
extra.arguments | Any extra arguments. | No |
Stopping the OpenCCM Interface Repository
The task_IR3_stop task supports the following arguments:
Argument | Description | Required |
extra.arguments | Any extra arguments. | No |
Starting the MOF Repository
The task_mof_start task supports the following arguments:
Argument | Description | Required |
extra.arguments | Any extra arguments. | No |
Stopping the MOF Repository
The task_mof_stop task supports the following arguments:
Argument | Description | Required |
extra.arguments | Any extra arguments. | No |
How to integrate a new piece of code?
Integrating source code into an existing package
If you want to compile a piece of source code which is
related to an existing package of OpenCCM, you just have to
put your class(es) into the appropriate directory.
No modification of the build process is required in order to
take into account your contribution.
Integrating source code into a new package
If you want to compile a new package, you have to follow
these steps:
- Create the directory tree associated to the new package.
- Put your contribution in the directory.
- Find the module where the package could take place.
- Edit the related property file:
- Edit the name of the package.
- Edit the name of the archive.
- Edit the related XML file:
- Add new entries in the callbacks (init, compile_api, compile_lib, build).
- Create the task associated to the new entries.
Defining a new module
You have to extend the build process:
- Find a module name
- Create the <module_name>.properties file
- Create the <module_name>.xml file
- Edit the <module_name>.xml file:
- Create the required callbacks (init, compile_api,
compile_lib and build).
- Load the associated property file.
- Edit the build.xml file:
- Include the new module declaration in the header of
the file.
- Import the content of the XML file.
- Add the new targets you define through callbacks in
the compilation chain.
- Follow the steps defined in the previous section to
compile your packages.
|