Qafoo/build-commons — pull request #2 by jakobwesthoff (2012-05-10 15:19:10+00:00)
Title: Introduced `bundle` build step

I introduced a new build step, which is execute between `test` and `package`:

test -> bundle -> package

The bundle step copies the `commons.srcdir` directory to a temporary build location. Furthermore I modified the different package operation (including the `archive` extension) to utilize this newly temporary build-location as a source instead of the real source directories.

This change allows extensions to easily hook into a processing step, where they may apply arbitrary changes to all of the srcdirs, while not changing the project itself. Examples for those steps are: JavaScript compiling/minifying, CSS compiling/minifying, Image optimization, ….

The `bundle` build step creates a new set of directory property, which can be used to easily access all the different kinds of directories during bundling as well as packaging. All of those properties are named after their counterpart inside the general commons environment, but are prefixed with `bundle:`:

- `commons.srcdir` -> `bundle:commons.srcdir`
- `commons.srcdir.js` -> `bundle:commons.srcdir.js`
- …

The relative directory tree position of those directories in relation to each other is not changed. This does only work, if all source directories are stored as a direct or indirect sub directory of `commons.srcdir`. Looking at all the other modules/extensions this is in implicit requirement. Therefore everything should work fine.

Another addition of this PR is the creation of a `commons.srcdir.htdocs`, which may house html files of javascript only applications or static pages, as well as css and image files. In most situations it would make sense to place the `commons.srcdir.js` beneath this directory as well. This is neither the default nor a requirement. Maybe image, as well as css files should get their own `commons.srcdir.*` path. We should discuss this, otherwise I will again think about this if I need it ;).