Commit Graph

65 Commits

Author SHA1 Message Date
Andreas Hocevar d2eceab25e Merge pull request #2643 from ahocevar/interface-externs
Handle interfaces in the generate-externs task
2014-08-28 13:22:15 +02:00
Andreas Hocevar 663fef3dfd Support nullable params and returns in generated externs 2014-08-27 18:18:49 +02:00
Andreas Hocevar e560f529c6 Handle interfaces in the generate-externs task 2014-08-27 16:13:12 +02:00
Andreas Hocevar e9457461af Process typedefs last
Becasue typedefs sometimes use namespaces that are actually
constructors, we need to process typedefs after symbols to avoid
duplicate entries for such namespace types.
2014-08-26 22:21:25 +02:00
Bart van den Eijnden ddb4d9ae83 Merge pull request #2151 from bartvde/license
Builds should include license
2014-08-25 08:27:23 +02:00
Peter Robins 8dab12f0d4 Fix typo in generate-exports 2014-08-22 15:42:24 +01:00
Tim Schaub f17c33f631 Rename buildcfg to config 2014-08-22 07:28:05 -06:00
Bart van den Eijnden a5dd13c5f1 Add a reference to the license to the build 2014-08-22 10:10:21 +02:00
Tim Schaub c7f45819ae Merge pull request #2482 from tschaub/lint-tasks
Lint tasks.
2014-08-19 12:30:26 -06:00
Tim Schaub 30bfa1bf19 Remove additional lint from new tasks 2014-08-19 12:15:11 -06:00
Éric Lemoine 2c9e822808 Merge pull request #2410 from probins/taskreadme
Additional clarifications for tasks/readme
2014-08-19 12:27:25 +02:00
Tim Schaub 33b68123ac Add jshint config for tasks and remove lint 2014-08-18 17:22:57 -06:00
Andreas Hocevar 286db65d34 Use {*} instead of {goog.*} types in externs file 2014-08-09 09:05:54 +02:00
Andreas Hocevar e294ca1868 Keep track of all symbols
This avoids that we add parent namespaces of symbols that were already
added because they have their own definition in the externs.
2014-08-09 08:53:25 +02:00
Andreas Hocevar 63abbe2597 Prepend 'var ' for root symbols 2014-08-09 08:53:24 +02:00
Andreas Hocevar e8eebd8846 Allow to provide externs for inclusion in info.json 2014-08-09 08:53:24 +02:00
Andreas Hocevar 53e12e7e47 Add typedefs for externs/olx.js contents 2014-08-04 20:37:46 +02:00
Andreas Hocevar 58f857bbb6 Test whether externs/olx.js is newer than build/info.json 2014-08-04 20:37:45 +02:00
Andreas Hocevar 33a627b7ce Include externs/olx.js in the info generation 2014-08-04 20:37:45 +02:00
Andreas Hocevar a40170feb7 Include typedefs in externs 2014-08-04 20:37:45 +02:00
Andreas Hocevar 46b74cedf8 Only add object type definition when there is no constructor 2014-08-04 20:37:44 +02:00
Andreas Hocevar 66bde546c0 Avoid duplicate constructors 2014-08-04 20:37:44 +02:00
Andreas Hocevar 1e79acac20 Build externs file from info.json
This change adds all information that is needed to generate the externs
file to build/info.json, so tasks/generate-externs.js no longer needs
to spawn JSDoc.
2014-08-04 20:37:44 +02:00
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