Development: ModuleModuleThis document describes how to add a new module to the build system. NamingProject module names should be names that are valid file names on all development platforms. Therefore please stick to the following pattern: [A-Za-z-], use - instead of spaces or underscores. Module names must be unique in the whole build system regardless of their location. For example it is not possible to both have a module foo/test and bar/test since the build system could not distinguish between the two. Rather name them foo-test and bar-test. LocationBasically a module can be stored whereever you like. However modules should be grouped by type, e.g. all example modules should be stored in the examples directory. Please take a look at the overall build structure and choose a suitable location. The path of a module is not part of its identification. See the section about naming above for more information. Directory StructureThe directory structure of each module is as follows:
Build SystemIn order to support a newly created module the build system has to be adjusted in several locations. This might be enhanced in a future release but for the moment new modules have to be integrated manually. Module Build FileThe module build file can provide hooks to be called by the main build scripts to provide extra functionality to tasks like compile/distribution/etc. or it can completely replace them. It would be out of scope to describe all you can do in a module build file, instead please have a look at the existing module build files and check what you can do. There is only one single mandatory entry for each build file which is called <module-name>.path. This has to be a property which contains the location of the module folder relative to the root directory. (Do not use the location attribute, instead use the value attribute and use the slash / as directory separator.) The targets in your module build file have to be prefixed with the name of the module followed by a dot. Example: If your module is called foo then all properties and tasks must be prefixed with foo. like e.g. foo.path. Main Build FileThe main build file build.xml has to be adjusted to include the newly created module:
The targets in your module build file have to be prefixed with the name of the module followed by a dot. Example: If your module is called foo then all properties and tasks must be prefixed with foo. like e.g. foo.path. VersioningThe path of a module is not part of its identification. See the section about naming above for more information. All modules in the build system are versioned. To enable a module for versioning a new versioning section has to be added to the corresponding build files:
Here is what a sample section might look like for a module called mynewmodule (note that the path ${mynewmodule.path} has to be defined in the module build file): <section name="examples-ejb" type="version" module="mynewmodule" prefix="Version" buildfile="${project.dir}/${mynewmodule.path}/${project.module.version.file}" /> Once the module section information has been inserted the module versioning information itself is created using the standard build version command. |