X-Cart:Generating module distribution packs for X-Cart 4

From X-Cart 4 Classic
Jump to: navigation, search

This article is intended for X-Cart 4 module developers; it explains how to prepare an installable module distribution pack.

For the purpose of explanation, we prepared a sample module archive. Please feel free to download it and use it as a template for your own work.

Here it is:

Cn_module.4.7.x.tgz
Cn_module.4.6.x.tgz

This archive contains:

  • files of the demo module Chuck Norris for X-Cart version 4.6.3 or 4.7.8;
  • config files for the generation of the module distribution pack;
  • the module's installer that creates entry points for the module, copies the module's files and applies sql files.

To generate a distribution pack for the module:

1. Copy the archives x-cart-4.7.8gold.tgz and x-cart-4.7.8platinum.tgz to the folder /www/releases/4.7.x/4.7.8/
The result should be:
/www/releases/4.7.x/4.7.8/x-cart-4.7.8gold.tgz
/www/releases/4.7.x/4.7.8/x-cart-4.7.8platinum.tgz
If you prefer to use a folder other than /www/releases/, you should change the paths in the files build_4.7.xgold.xml/build_4.7.xplatinum.xml accordingly.
For example, if you choose to place your archives in the folder /tmp/4.7.x/4.7.8/, you should locate the following code piece in build_4.7.xgold.xml/build_4.7.xplatinum.xml:
<target name="checkout_orig_ver">
<exec executable="tar" failonerror="true" dir="orig"><arg line="-xzf /www/releases/${branch}/${ver}/x-cart-${ver}gold.tgz" /></exec><move file="orig/xcart" tofile="orig/${ver}" />
</target>
and change the path to the following:
<target name="checkout_orig_ver">
<exec executable="tar" failonerror="true" dir="orig"><arg line="-xzf /tmp/${branch}/${ver}/x-cart-${ver}gold.tgz" /></exec><move file="orig/xcart" tofile="orig/${ver}" />
</target>
2. Install ant http://ant.apache.org/
3. In the command line, run the following sequence of commands:
ant -Dmversion="3" -f build_4.7.xplatinum.xml;
ant -Dmversion="3" -f build_4.7.xgold.xml short;
The module distribution packs will be generated to the folder ./releases/ in your current folder.
Once the distribution pack has been generated, make sure that the folder releases/4.7.8/chuck-norris.patches contains only the changes pertaining to your module


See also