Merge pull request #958 from tschaub/requires

Make the `build/check-requires-timestamp` target work with namespace provides in cases where the namespace provide isn't required by a module that provides constructors or other objects within that namespace.  This may seem a bit odd, but if I want to provide `foo.bar.Bam` it isn't strictly necessary that my module require `foo.bar`.

To make this build target work, we stick with the following convention (used in the Closure Library):

 * If you want to make a function available via `goog.require`, use `goog.provide` to provide the object of which the function is a member (e.g. to make the `foo.bar.baz` function available, use `goog.provide('foo.bar')`).
This commit is contained in:
Tim Schaub
2013-09-07 08:13:06 -07:00
28 changed files with 53 additions and 48 deletions

View File

@@ -1,9 +1,6 @@
// FIXME works for View2D only
goog.provide('ol.animation.bounce');
goog.provide('ol.animation.pan');
goog.provide('ol.animation.rotate');
goog.provide('ol.animation.zoom');
goog.provide('ol.animation');
goog.require('ol.PreRenderFunction');
goog.require('ol.ViewHint');

View File

@@ -1,4 +1,4 @@
goog.provide('ol.control.defaults');
goog.provide('ol.control');
goog.require('ol.Collection');
goog.require('ol.control.Attribution');

View File

@@ -6,7 +6,7 @@ goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('ol.animation.zoom');
goog.require('ol.animation');
goog.require('ol.control.Control');
goog.require('ol.css');
goog.require('ol.easing');

View File

@@ -15,7 +15,7 @@ goog.require('goog.fx.Dragger.EventType');
goog.require('goog.math');
goog.require('goog.math.Rect');
goog.require('goog.style');
goog.require('ol.animation.zoom');
goog.require('ol.animation');
goog.require('ol.control.Control');
goog.require('ol.css');
goog.require('ol.easing');

View File

@@ -3,7 +3,6 @@ goog.provide('ol.geom.SharedVertices');
goog.require('goog.asserts');
goog.require('ol.Coordinate');
goog.require('ol.CoordinateArray');
goog.require('ol.geom'); // TODO: remove this when #958 is addressed
/**

View File

@@ -3,9 +3,7 @@
goog.provide('ol.interaction.Interaction');
goog.require('ol.MapBrowserEvent');
goog.require('ol.animation.pan');
goog.require('ol.animation.rotate');
goog.require('ol.animation.zoom');
goog.require('ol.animation');
goog.require('ol.easing');

View File

@@ -1,4 +1,4 @@
goog.provide('ol.interaction.defaults');
goog.provide('ol.interaction');
goog.require('ol.Collection');
goog.require('ol.Kinetic');

View File

@@ -3,7 +3,7 @@ goog.provide('ol.Kinetic');
goog.require('ol.Coordinate');
goog.require('ol.PreRenderFunction');
goog.require('ol.animation.pan');
goog.require('ol.animation');

View File

@@ -50,13 +50,13 @@ goog.require('ol.TileQueue');
goog.require('ol.View');
goog.require('ol.View2D');
goog.require('ol.ViewHint');
goog.require('ol.control.defaults');
goog.require('ol.control');
goog.require('ol.extent');
goog.require('ol.interaction.defaults');
goog.require('ol.interaction');
goog.require('ol.layer.LayerBase');
goog.require('ol.layer.LayerGroup');
goog.require('ol.proj');
goog.require('ol.proj.addCommonProjections');
goog.require('ol.proj.common');
goog.require('ol.renderer.Map');
goog.require('ol.renderer.canvas.Map');
goog.require('ol.renderer.canvas.SUPPORTED');
@@ -1217,7 +1217,7 @@ ol.RendererHints.createFromQueryData = function(opt_queryData) {
};
ol.proj.addCommonProjections();
ol.proj.common.add();
if (goog.DEBUG) {

View File

@@ -13,10 +13,11 @@
@exportProperty ol.ProjectionUnits.METERS
@exportSymbol ol.proj.addProjection
@exportSymbol ol.proj.addCommonProjections
@exportSymbol ol.proj.get
@exportSymbol ol.proj.getTransform
@exportSymbol ol.proj.getTransformFromProjections
@exportSymbol ol.proj.transform
@exportSymbol ol.proj.transformWithProjections
@exportSymbol ol.proj.configureProj4jsProjection
@exportSymbol ol.proj.common.add

View File

@@ -1,4 +1,4 @@
goog.provide('ol.proj.addCommonProjections');
goog.provide('ol.proj.common');
goog.require('ol.proj');
goog.require('ol.proj.EPSG3857');
@@ -8,7 +8,7 @@ goog.require('ol.proj.EPSG4326');
/**
* FIXME empty description for jsdoc
*/
ol.proj.addCommonProjections = function() {
ol.proj.common.add = function() {
// Add transformations that don't alter coordinates to convert within set of
// projections with equal meaning.
ol.proj.addEquivalentProjections(ol.proj.EPSG3857.PROJECTIONS);