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
- 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:
- Copy WCBD_installdir/extract/wcbd-extract.private.properties.template as WCBD_installdir/extract-scm.private.properties.
- Copy WCBD_installdir/extract/wcbd-extract.properties.template as WCBD_installdir/extract-scm.properties.
- Copy WCBD_installdir/extract/wcbd-extract.xml.template as WCBD_installdir/extract-scm.xml.
- Change the file permission
with the following commands:
chmod 755 WCBD_installdir/extract-scm.*
- 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.
- 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.
- Open WCBD_installdir/extract-scm.properties with
a text editor and add any properties that are needed by WCBD_installdir/extract-scm.xml.
- If new functionality is needed in the Ant build:
- Create a helper Ant build file that is called WCBD_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.
- If new security-sensitive properties, such as user names
and passwords, are needed for the new changes:
- Copy WCBD_installdir/wcbd-build.private.properties.template as WCBD_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.
- If new properties are needed for the new changes:
- Copy WCBD_installdir/wcbd-build.properties.template as WCBD_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.
- If new libraries are needed by Ant for the new changes:
- Copy WCBD_installdir/wcbd-setenv*.template as WCBD_installdir/project-setenv*.template.
- Update the
CLASSPATH
variable in WCBD_installdir/project-setenv.bat.template.
These files become the new setenv template
files for configuration.
- To include the new or modified functionality in the overall
build process:
- Copy WCBD_installdir/wcbd-build.xml as WCBD_installdir/project-build.xml.
- 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" />
- Modify the logic of the build process to incorporate
the new changes. Refer to the comments in the file for details.