The Stubbles build system

To ease the development with Stubbles, we provide a build-system, that takes care of commonly needed tasks. To make use of this build system, you will have to install Phing. If you need help installing this requirement, please take a look at installing Phing.

Please note: starting with Stubbles 1.1.0 the required Phing version is at least Phing 2.4.0.

Setting up your installation

After you downloaded the Stubbles release and extracted the archive, you are ready to setup your installation:

*nix systems:

$ cd /path/to/stubbles
$ ./stubbles

Windows:

$ cd /path/to/stubbles
$ stubbles.bat

After running this command, you will be asked several questions:

installation name
The build process will ask you for the name of your installation. This is only needed for the Phing build file, it can easily be changed afterwards. If your project name contains ampersands please make sure that you mask them as & by yourself instead of just typing &. Not masking the ampersand results in a broken generated build file.
permissions for cache folder
The build process will automatically set the permissions for all folders, that will contain cache files. Please make sure, that the cache permissions allow the webserver to write in these folders.

Create a new project

$ cd /path/to/stubbles
$ phing setup-project

First you will be asked for the name of the new project. This will be the name of the project's directory within the projects folder.

Second you will be asked for the project you want to copy the config files from. By default it will use the dist project.

Enabling JSON-RPC functionality
If you want to build an AJAX powered site, please answer this questions with Y to copy all required files.
enable variant manager
If you want to use variants in your website, answer this question with Y to copy the required configuration files.

All available commands

The stubbles build script provides various commands that help you with common tasks. To run a command, just execute the following line in your shell:

$ phing [commandname]

Besides setup-project the build script provides the following commands:

setup-examples
This command will make sure that the included examples work on your server or provides information, why the examples are not working.
clean-dist
This command will remove dist project from your installation. You should only run this after you created your first project, else you will have to set up your project manually.
clean-examples
This command will remove the example project and all related files in the src directory.
clear-cache
This will remove all cache files from your installation. Make sure, that the user who runs this command has the permissions to delete files written by the webserver.

Starting the build

After you finished the project setup and adjusted all configuration options?, you are ready to start the build. All, that is needed for this is running Phing:

$ phing
Buildfile: path/to/stubbles/build.xml

MyProject > main:

...

BUILD FINISHED

Total time: 1.2271 second

The output of the build process depends on the selections you made during project setup and the Stubbles version and components you are using.

Adjusting the build process

The build process is completely managed by Phing and can easily be adjusted. After the project setup has been finished, the root folder of your project will contain to build files:

  • build.xml
  • build-stubbles.xml
  • build-project.xml

Feel free to modify the build.xml file to make additions to the build process. All tasks provided by Stubbles are defined in the build-stubbles.xml and build-project.xml file, which must not be changed manually, as new versions will provide improved build scripts.