Setting up source extraction Ant script

The HCL Commerce Build tool requires you to provide a custom source extraction Ant build file. This file is run as part of the build process.

The WCB_installdir/extract directory includes sample scripts for some SCMs:
SCM Sample script
CVS wcbd-sample-extract-cvs.*
ClearCase wcbd-sample-extract-clearcase.*
Local file system wcbd-sample-extract-local.*
Subversion wcbd-sample-extract-svn.*
Git wcbd-sample-extract-git.*

If no sample scripts are provided for your SCM, you can develop a custom script. For more information, see Customizing the packaging process.

Before you begin

Note: For Git support,
  1. As a prerequisite, install a Git client and ensure the Git commands are in the system or user path.
  2. Before running a WCB build, clone your Git project to your local machine, and make sure that the git pull command can be executed with success. Use the ssh protocol to communicate with Git. Other protocols, such as https, are not supported.
  3. If you are using an alternative Git configuration, you can enable it by customizing the Ant script extract-git.xml.

About this task

The following steps use these conventions:

  • Application specific scripts or property files are distinguished by application type. In following steps, apptype stands for the application type that is currently being built. It could take the values ts, crs, search, xc or data.
  • scm refers to the method by which the source code is extracted. The scm can be local or any supported SCM type, for example, cvs, svn, or git.

In the following steps, scm refers to one of cvs, clearcase, local, or svn.

Procedure

  1. Set security-sensitive configurations that will be used in the extract process..
    1. If WCB_installdir/extract/wcbd-sample-extract-scm.private.properties exists, copy the file as WCB_installdir/extract-scm-apptype.private.properties.
      For example,
      extract-svn-ts.private.properties
    2. Open the file with a text editor and configure the properties according to the comments in the file.
  2. Set non-sensitive configurations that will be used in the extract process.
    1. Copy WCB_installdir/extract/wcbd-sample-extract-scm.properties as WCB_installdir/extract-scm-apptype.properties.
      For example,
      extract-svn-ts.properties
    2. Open the file with a text editor and configure the properties according to the comments in the file.
  3. Copy WCB_installdir/extract/wcbd-sample-extract-scm.xml as WCB_installdir/extract-scm.xml.
    For example,
    extract-svn.xml
  4. Open WCB_installdir/extract-scm.xml with a text editor and replace the name attribute of the root project element from wcbd-sample-extract-scm to extract-scm.
    For example, if the SCM is svn, then the WCB_installdir/extract-svn.xml should have the following line:
    <project name="wcbd-sample-extract-svn" default="all">
    changed to:
    <project name="extract-svn" default="all">