Customizing the build process

Advanced users can customize the build process by using the Apache Ant scripting language.

About this task

scm refers to an identifier that represents your Source Control Management (SCM) system.
Tip: WCBD_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

  1. Optional: Develop custom scripts to integrate with your SCM. This step is required if the SCM used in your customization project is not one for which sample scripts are provided. For more information, see set up the source extraction Ant script.
    1. Copy WCBD_installdir/extract/wcbd-extract.private.properties.template as WCBD_installdir/extract-scm.private.properties.
    2. Copy WCBD_installdir/extract/wcbd-extract.properties.template as WCBD_installdir/extract-scm.properties.
    3. Copy WCBD_installdir/extract/wcbd-extract.xml.template as WCBD_installdir/extract-scm.xml.
    4. LinuxAIXFor IBM i OS operating system Change the file permission with the following commands:
      chmod 755 WCBD_installdir/extract-scm.*
    5. Open WCBD_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.
    6. Open WCBD_installdir/extract-scm.private.properties with a text editor and add any security-sensitive properties that are needed by WCBD_installdir/extract-scm.xml.
    7. Open WCBD_installdir/extract-scm.properties with a text editor and add any properties that are needed by WCBD_installdir/extract-scm.xml.
  2. Optional: Add functions to the Ant build:
    1. Create a helper Ant build file that is called WCBD_installdir/project-build-common.xml.
    2. 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"/>
    3. 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.
  3. Optional: Add security-sensitive properties, such as user names and passwords:
    1. Copy WCBD_installdir/wcbd-build.private.properties.template as WCBD_installdir/project-build.private.properties.template.
    2. 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.
  4. Optional: Add properties:
    1. Copy WCBD_installdir/wcbd-build.properties.template as WCBD_installdir/project-build.properties.template.
    2. 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.
  5. Optional: Add libraries:
    1. Copy WCBD_installdir/wcbd-setenv*.template as WCBD_installdir/project-setenv*.template.
    2. Update the CLASSPATH variable in WCBD_installdir/project-setenv.bat.template.
    These files become the new setenv template files for configuration.
  6. Include new or changed functions in the overall build process:
    1. Copy WCBD_installdir/wcbd-build.xml as WCBD_installdir/project-build.xml.
    2. If the new helper Ant build file WCBD_installdir/project-build-common.xml was created with previous steps, change the following line in WCBD_installdir/project-build.xml:
      <import file="${basedir}/wcbd-build-common.xml" />
      to:
      <import file="${basedir}/project-build-common.xml" />
    3. Modify the logic of the build process to incorporate the new changes. Refer to the comments in the file for details.

    Customizing the files that are used for Configuring the build settings and Running the build process is done in the same manner as the default assets, except that the project-* files are used instead of the wcbd-* files.