Customizing the build process

Advanced users can customize the build process by using the Apache Ant scripting language. This task guides you through creating your customization files for use with the WebSphere Commerce Build and Deployment tool.

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: When you set up the source extraction Ant script, if the SCM used in your customization project is not one for which sample scripts are provided, you must develop custom scripts to integrate with your SCM:
    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. SolarisLinuxAIXFor IBM i OS operating systemChange 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. If new functionality is needed in 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. If new security-sensitive properties, such as user names and passwords, are needed for the new changes:
    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. If new properties are needed for the new changes:
    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. If new libraries are needed by Ant for the new changes:
    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. To include the new or modified functionality 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.