Customize the packaging process
Advanced users can customize the build process using the Apache Ant scripting language.
Task info
scm refers to an identifier that represents your Source Control Management (SCM) system.Tip: WCB_installdir/wcbd-build-common.xml provides helper Ant targets that are reusable and serves as examples for customization. For more information, review the commented sections within the wcbd-build-common.xml file.
Procedure
- Optional: Develop custom scripts to integrate with your SCM. This step is required if the SCM used in our customization project is not one for which sample scripts are provided. For more information, see set up the source extraction Ant script.
- Copy WCB_installdir/extract/wcbd-extract.private.properties.template as WCB_installdir/extract-scm.private.properties.
- Copy WCB_installdir/extract/wcbd-extract.properties.template as WCB_installdir/extract-scm.properties.
- Copy WCB_installdir/extract/wcbd-extract.xml.template as WCB_installdir/extract-scm.xml.
- (AIX) (IBM i) (Linux) Change the file permission with the following commands:
chmod 755 WCB_installdir/extract-scm.*
- Open WCB_installdir/extract-scm.xml with a text editor and replace the name attribute of the root project element from wcbd-extract to extract-scm. Then, write the custom logic to extract the source code from your SCM. Refer to comments in the file for details.
- Open WCB_installdir/extract-scm.private.properties with a text editor and add any security-sensitive properties that are needed by WCB_installdir/extract-scm.xml.
- Open WCB_installdir/extract-scm.properties with a text editor and add any properties that are needed by WCB_installdir/extract-scm.xml.
- Optional: Add functions to the Ant build:
- Create a helper Ant build file called WCB_installdir/project-build-common.xml.
- Open the file with a text editor and add the following line after the root project element open tag:
<import file="${basedir}/wcbd-build-common.xml"/>
- Add new targets to the file as needed. The existing helper target and any target that might depend on it can be overridden based on the specification of the Ant import task.
- Optional: Add security-sensitive properties, such as user names and passwords:
- Copy WCB_installdir/wcbd-build.private.properties.template as WCB_installdir/project-build.private.properties.template.
- Add the new properties to the end of the file. Refer to comments in the file for details.
This file becomes the new properties template file for configuration.
- Optional: Add properties:
- Copy WCB_installdir/wcbd-build.properties.template as WCB_installdir/project-build.properties.template.
- Add the new properties to the end of the file. Refer to the comments in the file for details.
This file becomes the new properties template file for configuration.
- Optional: Add libraries:
- Copy WCB_installdir/wcbd-setenv*.template as WCB_installdir/project-setenv*.template.
- Update the CLASSPATH variable in WCB_installdir/project-setenv.bat.template.
These files become the new setenv template files for configuration.
- Include new or changed functions in the overall build process:
- Copy WCB_installdir/wcbd-build.xml as WCB_installdir/project-build.xml.
- If the new helper Ant build file WCB_installdir/project-build-common.xml was created with previous steps, change the following line in WCB_installdir/project-build.xml:
<import file="${basedir}/wcbd-build-common.xml" />to:
<import file="${basedir}/project-build-common.xml" />
- Modify the logic of the build process to incorporate the new changes. Refer to the comments in the file for details.
Customizing the files used for Configure packaging settings and Building packages is done in the same manner as the default assets, except that the project-* files are used instead of the wcbd-* files.
Related reference
Custom Ant tasks