Custom Infusion Builds With Ant
Using the custom build scripts
The Infusion build scripts are typically run from a command line. You must be in the build-scripts directory to run the scripts.
The most typical use of the build scripts will be using the customBuild target with one or more of three optional parameters: 'include', 'exclude', and 'jsfilename'. (See the #Options section below for more information about these and other parameters.) The following example shows what this would look like.
ant -lib lib/rhino customBuild -Dinclude="<list of modules to include>" -Dexclude="<list of modules to exclude>" -Djsfilename="<desired file name>"
The values passed to 'include' and 'exclude' are comma separated lists of module names (see the list of #Modules below for supported module names). If you specify a module to include, all of the module's dependencies will also be included. By contrast, if you specify a module to exclude, only that module will be excluded - not its dependencies.
Use excludes with caution
If you exclude a module that is a required dependency, then it must be included in your website in another way for Infusion components to work.
Some examples:
URL rewriting
Infusion builds include a single js file, InfusionAll.js, that includes the necessary dependency files. However, the HTML files are bundled with the <script> and <link> blocks all pointing at the individual files.
To create a build that comes with the references in the <head> rewritten to point at the single .js file:
In v1.1: Run the custom build scripts with the rewriteHead option set to "true":
ant -lib lib/rhino -DrewriteHead="true"
In v1.2: Run the infusionAllBuilds ant target:
ant -lib lib/rhino infusionAllBuilds
Warning
The infusionAllBuilds target (or the rewriteHead option in v1.1) is intended to be used alone. It will run without error if the same options as the customBuild target (e.g. include, exclude, etc.) are provided, however the HTML files will link to both the single concatenated file and the individual required files.
Rhino
Portions of the Infusion build system are written in JavaScript, and are connected with the Ant-based system using the Rhino engine.
If you'd rather not specify the -lib parameter every time you run a build, you can upgrade the copy of Rhino installed by Ant in your $ANT_HOME/lib directory with the newer version distributed in Infusion's build-scripts/lib/rhino directory. On Mac OS X:
sudo rm -rf /usr/share/ant/lib/js-1.6R7.jar
sudo cp lib/rhino/js.jar /usr/share/ant/lib/js-1.7R3.jar
Modules
Name | Notes |
|---|---|
Component Modules: |
|
inlineEdit |
|
pager |
|
progress | Included with the Uploader component by default |
reorderer |
|
tabs | Included with the UI Options component by default |
tableOfContents | Included with the UI Options component by default |
tooltip | Included with the Inline Edit component by default |
uiOptions |
|
undo | Included with the Inline Edit component by default |
uploader |
|
Framework Modules: |
|
framework | Will automatically be included with any component module |
renderer | Will automatically be included with any component module that requires it |
fastXmlPull | Will automatically be included with the Renderer and any component that requires the Renderer |
json |
|
fss | Including the |
fssReset |
|
fssLayout | If you wish to exclude all of FSS, you will need to exclude all fss modules |
fssText |
|
fssThemes |
|
External libraries: |
|
jQuery | Will automatically be included with any component module |
jQuerybgiframePlugin | Required by |
jQueryDelegatePlugin | Required by |
jQueryUICore |
|
jQueryUIWidgets | Required by |
jQueryTooltipPlugin | Required by |
swfupload | Included with the Uploader component by default |
swfobject | Included with the Uploader component by default |