mozilla-b2g/gaia — pull request #10868 by jrburke (2013-07-09 17:05:57+00:00)
Title: Bug 890182 Allow apps to specify a directory to use for builds

This changeset touches some common build files as well as some email files. This was done to test out the the common build changes and show that they are working.

## Common changes

* build/utils.js: sets a buildDirectoryFile for each webapp, set initially to sourceDirectoryFile. If the app has a gaia_build.json file, it will read that and set the "dir" property in there to buildDirectoryFile.
* The build/webapp-*.js files use this buildDirectoryFile when dealing with what directory to use for build steps.
* build/webapp-zip.js now reads a buildDirectoryFile + 'gaia_shared.json" file to get shared resources that should be included in the zip, as well as do the existing HTML scanning it does before this changeset.

## Email changes

* Specifies a gaia_build.json setting the "dir" for buildDirectoryFile to be gaia/build_stage/email.
* Runs a "full project" optimization inside build_stage/email. This sets the stage for doing other optimized layers that depend on each other.
* Adds email/build/make_gaia_shared.js that generates the gaia_shared.json for a build by scanning JS dependencies for "shared/*" dependencies and CSS for @import calls that reference shared CSS files.
* html_cache_restore.js is more generic, reading data- attributes for its work. Also only loads a loader when in dev (make DEBUG=1) so that the source can run as-is in desktop browsers (data-loader attribute removed in the build process)
* Removed some unneeded files.