openlayers/ol3 — pull request #1979 by tschaub (2014-04-10 21:29:27+00:00)
Title: Allow for easier custom builds

This changes a number of things in support of a configurable build tool:

* `*.exports` files are removed in favor of `@todo api` annotation in the source files (this will become `@api` when we move on from Plovr)
* a `tasks/generate-symbols.js` task produces a `build/symbols.json` file with metadata about exportable symbols
* a `tasks/generate-exports.js` task produces a `build/exports.js` script with `goog.exportProperty` and `goog.exportSymbol` calls
* the `build.py` script has been modified to call the above tasks

Currently, the way the `generate-exports.js` task is called, it generates an `exports.js` file that exports all exportable symbols. This task also supports generating exports for a subset of all symbols by passing it a JSON configuration file with a list of symbols or symbol patterns. An example configuration file might look like this:

```json
{
"exports": [
"ol.Map",
"ol.layer.Vector",
"ol.layer.Vector#*",
"ol.BrowserFeature.*"
]
}
```
Items in the `exports` array that end with `*` are patterns. Patterns match longer names that start with the string before the `*`. The `#` indicates a prototype property. So the above configuration would generate exports for the `ol.Map` constructor, the `ol.layer.Vector` constructor, all vector layer methods, and all constants in the `ol.BrowserFeature` namespace.

This is the first part of a build configuration. The next part is a set of options for the compiler. A config file with both of these parts will get passed to a `tasks/build.js` script that 1) generates exports, 2) sorts lib files in dependency order, and 3) drives the compiler.

I'd like to make some additional enhancements (e.g. add tests for the tasks added above, add the build task). But this is open for comments.

@ahocevar is going to make some changes to the JSDoc plugin that currently parses `*.exports` files (making it instead read the single `build/symbols.json` file).