Difference between revisions of "X-Cart:Generating module distribution packs for X-Cart 4"

From X-Cart 4 Classic
Jump to: navigation, search
m (Created page with '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…')
 
m
Line 4: Line 4:
  
 
Here it is:<br />
 
Here it is:<br />
: <b>[[File:cn_module.tgz]]</b>
+
: <b>[[Media:cn_module.tgz | cn_module.tgz]]</b>
  
 
This archive contains:
 
This archive contains:
Line 13: Line 13:
 
To generate a distribution pack for the module:
 
To generate a distribution pack for the module:
  
: 1. Copy the archives '''x-cart-4.6.3gold.tgz''' and '''x-cart-4.6.3platinum.tgz''' to the folder '''/www/releases/4.6.x/4.6.3/'''  
+
: 1. Copy the archives '''x-cart-4.6.3gold.tgz''' and '''x-cart-4.6.3platinum.tgz''' to the folder '''/www/releases/4.6.x/4.6.3/'''
 
:: The result should be:
 
:: The result should be:
 
::: /www/releases/4.6.x/4.6.3/x-cart-4.6.3gold.tgz<br />/www/releases/4.6.x/4.6.3/x-cart-4.6.3platinum.tgz
 
::: /www/releases/4.6.x/4.6.3/x-cart-4.6.3gold.tgz<br />/www/releases/4.6.x/4.6.3/x-cart-4.6.3platinum.tgz
Line 22: Line 22:
 
<pre>
 
<pre>
 
<target name="checkout_orig_ver">
 
<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}" />
+
<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>
+
</target>
 
</pre>
 
</pre>
 
::and change the path to the following:
 
::and change the path to the following:
 
<pre>
 
<pre>
 
<target name="checkout_orig_ver">
 
<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}" />
+
<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>
+
</target>
 
</pre>
 
</pre>
 
: 2. Install '''ant''' http://ant.apache.org/
 
: 2. Install '''ant''' http://ant.apache.org/

Revision as of 17:28, 2 June 2014

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.tgz

This archive contains:

  • files of the demo module Chuck Norris for X-Cart version 4.6.3;
  • 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.6.3gold.tgz and x-cart-4.6.3platinum.tgz to the folder /www/releases/4.6.x/4.6.3/
The result should be:
/www/releases/4.6.x/4.6.3/x-cart-4.6.3gold.tgz
/www/releases/4.6.x/4.6.3/x-cart-4.6.3platinum.tgz
If you prefer to use a folder other than /www/releases/, you should change the paths in the files build_4.6.xgold.xml/build_4.6.xpro.xml accordingly.
For example, if you choose to place your archives in the folder /tmp/4.6.x/4.6.3/, you should locate the following code piece in build_4.6.xgold.xml/build_4.6.xpro.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.6.xpro.xml;
ant -Dmversion="3" -f build_4.6.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.6.3/chuck-norris.patches contains only the changes pertaining to your module