292 Commits

Author SHA1 Message Date
Andreas Hocevar
0d86e4a237 Document the generate-externs.js task 2014-08-04 20:37:44 +02:00
Andreas Hocevar
4cb60feb40 Add generate-externs task to create build/ol-externs.js 2014-08-04 20:37:43 +02:00
Tim Schaub
c3bddffecb Unconditionally add version info to the build header
This reworks the changes in #2442 so we always include the version info, regardless of whether the module is run as main or not.  This also addresses a few lint related issues.
2014-07-25 12:50:58 -06:00
tsauerwein
9102647751 Write version in builds 2014-07-25 16:10:08 +02:00
Peter Robins
eb8dc15d8d Additional clarifications for tasks/readme 2014-07-21 16:12:34 +00:00
Tim Schaub
0b9936107d Merge pull request #2377 from tschaub/portable-config
Make our build configs more portable by using the default src config.
2014-07-15 20:56:25 -06:00
Tim Schaub
aecaa52cb1 Make our build configs more portable by using the default src config
If a `src` config is not provided, by default, all of the library sources are included.  There is some special handling in the build task to make sure all library sources are included regardless of the path to the build config.  When someone includes a `src` config, path patterns are assumed to be relative to the current working directory (unless overriden with the `cwd` config).  So, when you use the `src` config, your config is no longer portable.
2014-07-14 17:52:10 -06:00
Tim Schaub
4f7073d7aa For jsdoc to find plugins, we need to set the cwd
This allows the `build.js` (and the exports from `generate-info.js`) to be run with a different working directory.
2014-07-14 14:42:42 -06:00
Tim Schaub
c93e80a14a Always regenerate info using all sources if any have changed
Because we don't know if a new or modified file includes changes to the class hierarchy, we regenerate info for all sources any time any one has changed.  An alternative would be to generate info first for the new or modified file and then (potentially) regenerate info for more source files in the class hierarchy, but this makes the generate-info.js task far more complicated.
2014-07-12 14:39:18 -06:00
Tim Schaub
8a3f1a8f34 Add mocha and mocha-phantomjs as dev dependencies 2014-07-06 11:40:08 -06:00
Tim Schaub
b452e04e08 Add a task to run the tests once with PhantomJS
The test.js task starts the development server and runs the tests in PhantomJS.  As mentioned in the readme, when running the tests continuously during development, it is more convenient to start the dev server and visit the root of the test directory in your browser.

Later we can bring in Karma to drive PhantomJS and other browsers, but this simple "run once" task is useful for the CI job.
2014-07-05 19:42:30 -04:00
Peter Robins
2e1957c42c Improve docs for define tag 2014-07-02 08:22:23 -04:00
Tim Schaub
a8a035468b Allow cwd to be configured for build
By default, all paths in the build config (e.g. externs) are assumed to be relative to the ol3 repo root.  To make it so relative paths are resolved from a different directory, use the cwd option.

In addition, this change makes it so the `build.js` task can be run from another directory.
2014-06-29 15:02:47 -04:00
Tim Schaub
fb7d39005e Unused var 2014-06-29 12:55:30 -04:00
Frederic Junod
f09c00462c Correct code type in tasks/readme 2014-06-18 13:42:32 +02:00
Peter Robins
986778cf0c Correct minor typo in tasks/readme 2014-06-18 08:10:26 +01:00
Éric Lemoine
be62e75714 Change sourceDir to src/ in generate-info.js
This is to accomodate the case where other directories than "ol" include "api" annotations. For example, the Swisstopo geoadmin folks extend OpenLayers 3 in an ol3 fork, and they have their own "ga" namespace/directory under "src". See https://github.com/geoadmin/ol3/tree/master/src.
2014-06-09 10:20:50 +02:00
Peter Robins
c1037ad3ee Clarify compiler exports in tasks readme 2014-05-29 14:43:30 +01:00
Peter Robins
a0cfdb1990 Tasks readme: update url for new compiler FAQ
As changed on closure-util https://github.com/openlayers/closure-util/pull/17 - just realised this link is here too.
2014-05-25 17:39:23 +01:00
Tim Schaub
c820a7a1f8 Additional doc for the namespace option
People should be discouraged from exporting to single letter namespaces to avoid collissions with the symbols generated by the compiler.
2014-05-21 13:22:40 +02:00
Tim Schaub
250f6901d3 Pass around single config object 2014-05-21 13:22:32 +02:00
Andreas Hocevar
3447f93bfe Document the new namespace option 2014-05-20 21:56:32 +02:00
Andreas Hocevar
cd4092f3e0 Allow to specify an objectToExportTo for goog.exportSymbol
This allows users to build ol3 without anything exposed in the
global namespace. This can e.g. be useful for creating an ol3
AMD module, by simply using a build configuration with
"define('ol',function(){var o={};%output%return o.ol;});" as
"output_wrapper".
2014-05-20 21:49:26 +02:00
Tim Schaub
c3184f2cce Support for debug builds (concatenation only)
Whitespace builds are still painful to debug.  Skipping the compiler altogether and simply concatenating sources is a better option for development and debugging.  By ommitting the `compile` option in a build config, the output is "uncompiled" - a straight concatenation of all sources in dependency order.
2014-05-14 10:39:51 -06:00
Tim Schaub
f9157a6123 Rename generate-symbols.js to generate-info.js
This task generates build related metadata for the library based on doc annotations.  Since it is about more than writing out exportable symbols, it makes sense to have a more general name.
2014-05-05 07:41:47 -07:00
Tim Schaub
48828a238a Generate metadata for boolean defines in addition to exportable symbols 2014-05-05 07:14:23 -07:00
Tim Schaub
ec6aa21912 Include goog.require calls in exports file 2014-04-29 09:57:25 -06:00
Tim Schaub
d087fdbefd Add list of provides to symbol metadata 2014-04-29 09:57:25 -06:00
Tim Schaub
fd170eb295 Accept a path for exports file 2014-04-29 09:57:19 -06:00
Tim Schaub
3dd5fb88e5 Allow configuration of JVM arguments in build 2014-04-29 09:53:07 -06:00
Tim Schaub
758eed357e Accept a src config, add docs 2014-04-29 09:53:06 -06:00
Tim Schaub
a28db38eef Parse options and add docs 2014-04-29 09:53:06 -06:00
Tim Schaub
b6277e0a01 Build task for driving the compiler 2014-04-29 09:53:06 -06:00
Tim Schaub
88e41f25ea Generate symbols before exports 2014-04-29 09:53:06 -06:00
Tim Schaub
88d67b7370 Regenerate symbols if parents have changed
The generate-symbols.js task runs JSDoc on source files.  Because this takes a long time (13s) to run on the whole library, the resulting symbols file includes additional metadata to make it possible to do incremental symbol generation on subsequent runs.  The 'path' and 'extends' metadata for a symbol are used to determine what needs to be regenerated.
2014-04-29 09:53:06 -06:00
Tim Schaub
c692204ffd Task for generating a limited set of exports 2014-04-29 09:53:05 -06:00
Tim Schaub
d3e477a8df Allow main method to be called from elsewhere 2014-04-29 09:53:05 -06:00
Tim Schaub
457cfe851a Add a task to generate metadata on exported symbols
This runs JSDoc with the "symbols" config, providing a list of source files that have been changed since the previous run.  The output is used to generate a symbols.json metadata file containing all exportable symbols info.  A separate task will be run to generate the exports.js file.  These same metadata files will be used by a build tool.
2014-04-29 09:53:05 -06:00
Tim Schaub
6fc915ba7b Strip tags from shortdesc (et al.) when parsing
This strips markup from elements with id attributes that we care about: title, shortdesc, tags.  This will only work for people who use `npm install && npm start` to browse examples.  The other example parser doesn't strip this markup, so it should still not be used in these elements.
2014-04-04 10:07:25 -06:00
Tim Schaub
3ce6c295be Add task for parsing examples 2014-02-03 14:59:06 -07:00
Tim Schaub
2b8e87f17f Add error handler
If the server fails to start, display error message and exit.  Typically this is due to the address being in use.
2014-01-10 12:05:38 -07:00
Tim Schaub
75fffd1f47 Making use of the closure-util package
This provides some initial development utilities for people using Node.

Instructions for installing:

    npm install

After pulling down the dependencies, you can start a developement server that provides the libraries (ol and Closure Library) in debug mode (not minified/compiled).  Run the dev server with the following:

    npm start

Currently, the example index page needs to be built with `build.py`.  After building that, you should be able to browse all static files, view the examples and run the tests.
2013-09-14 18:10:12 -06:00