Build HSLayersΒΆ

HSLayers is extension of OpenLayers, which consist from patches to original OpenLayers.js file and addons - custom widgets, controls, layers. It also adds some new stuff into style.css as well as customises some images. To get all of this integrated and setuped easily, you have to run the build script.

The script makes following:

  1. Adds patches to OpenLayers.js
  2. Adds patches to style.css
  3. Merges images with orignal ones
  4. Makes compressed version of each JavaScript file
  5. Makes comprehensive all-in-one files for each HSLayers widget (as MapPortal.js for example)

Everything is stored in the build directory (originally empty).

Now, we can build HSLayers:

cd hslayers/tools
python build.py --help

    Usage:
        build.py [options]

    Options:
    -h, --help            show this help message and exit
    -b, --build           Build all sources
    -r, --clear           Clear the build directory
    -d, --documentation   Build the documentation
    -p, --patch           Patch the OpenLayers with HSLayers patches
    -c, --compress        Compress HSLayers files
    -a, --apps            Build compressed classes needed by some high-level
                            classes and applications
    -i, --imagescss       Merge CSS and Images
    -t dir, --target=dir  Target directory:
                            /home/jachym/usr/src/hsrs/hslayers/trunk/build

The building script should have self-explaining help, but let’s talk about it more detaily:

-b, –build
Shortcut for clear, patch, compress, apps and documentation
-r, –clear
Delete everything from target directory
-d, –documentation
Build API documentation using jsdoc-toolkit utility (assumes, jsdoc is in the PATH)
-p, –patch
Add patches, CSS and images to OpenLayers
-c, –compress
Compress all JavaScripts - compress HSLayers
-a, –apps
Compress stuff in the Apps directory
-i, –imagescss
Do only images and CSS
-t, –target=dir
Store the results to any directory, default is hslayers/build

So, the easiest way how to build everything is:

python tools/build.py -b

Previous topic

Get HSLayers

Next topic

Setup HSLayers

This Page