37
build.py
37
build.py
@@ -126,6 +126,10 @@ GLSL_SRC = [path
|
||||
for path in ifind('src')
|
||||
if path.endswith('.glsl')]
|
||||
|
||||
JSDOC_SRC = [path
|
||||
for path in ifind('src')
|
||||
if path.endswith('.jsdoc')]
|
||||
|
||||
SHADER_SRC = [path.replace('.glsl', 'shader.js')
|
||||
for path in GLSL_SRC]
|
||||
|
||||
@@ -341,7 +345,8 @@ def serve_precommit(t):
|
||||
'buildcfg/ol-all.json', 'buildcfg/test.json')
|
||||
|
||||
|
||||
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp')
|
||||
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp',
|
||||
'build/check-whitespace-timestamp')
|
||||
|
||||
|
||||
@target('build/lint-timestamp', SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC,
|
||||
@@ -508,6 +513,36 @@ def build_check_requires_timestamp(t):
|
||||
t.touch()
|
||||
|
||||
|
||||
@target('build/check-whitespace-timestamp', SRC, INTERNAL_SRC, EXTERNAL_SRC,
|
||||
EXAMPLES_SRC, SPEC, EXPORTS, JSDOC_SRC,
|
||||
precious=True)
|
||||
def build_check_whitespace_timestamp(t):
|
||||
CR_RE = re.compile(r'\r')
|
||||
TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z')
|
||||
NO_NEWLINE_RE = re.compile(r'[^\n]\Z')
|
||||
ALL_WHITESPACE_RE = re.compile(r'\s+\Z')
|
||||
errors = 0
|
||||
for filename in sorted(t.newer(t.dependencies)):
|
||||
whitespace = False
|
||||
for lineno, line in enumerate(open(filename)):
|
||||
if CR_RE.search(line):
|
||||
t.info('%s:%d: carriage return character in line', filename, lineno + 1)
|
||||
errors += 1
|
||||
if TRAILING_WHITESPACE_RE.search(line):
|
||||
t.info('%s:%d: trailing whitespace', filename, lineno + 1)
|
||||
errors += 1
|
||||
if NO_NEWLINE_RE.search(line):
|
||||
t.info('%s:%d: no newline at end of file', filename, lineno + 1)
|
||||
errors += 1
|
||||
whitespace = ALL_WHITESPACE_RE.match(line)
|
||||
if whitespace:
|
||||
t.info('%s: trailing whitespace at end of file', filename)
|
||||
errors += 1
|
||||
if errors:
|
||||
t.error('%d whitespace errors' % (errors,))
|
||||
t.touch()
|
||||
|
||||
|
||||
virtual('plovr', PLOVR_JAR)
|
||||
|
||||
|
||||
|
||||
@@ -60,4 +60,3 @@ xhr.onload = function() {
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
/**
|
||||
* Object literal with config options for the overlay.
|
||||
* @typedef {Object} ol.OverlayOptions
|
||||
* @property {Element|undefined} element The overlay element.
|
||||
* @property {ol.Map|undefined} map The map to overlay onto.
|
||||
* @property {Element|undefined} element The overlay element.
|
||||
* @property {ol.Map|undefined} map The map to overlay onto.
|
||||
* @property {ol.Coordinate|undefined} position The overlay position in map
|
||||
* projection.
|
||||
* @property {ol.OverlayPositioning|undefined} positioning Positioning.
|
||||
* @property {ol.OverlayPositioning|undefined} positioning Positioning.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -50,24 +50,24 @@
|
||||
* units per pixel.
|
||||
* @property {number|undefined} numZoomLevels The number of zoom levels for this
|
||||
* view. Zoom level 0 uses the `maxResolution`; subsequent zoom levels are
|
||||
* calculated by dividing the previous resolution by `zoomFactor`.
|
||||
* calculated by dividing the previous resolution by `zoomFactor`.
|
||||
* @property {ol.ProjectionLike} projection The map projection.
|
||||
* @property {number|undefined} resolution The initial resolution for the view.
|
||||
* @property {number|undefined} resolution The initial resolution for the view.
|
||||
* @property {Array.<number>|undefined} resolutions The resolutions for this
|
||||
* view. If configured, this is equivalent to specifying `maxResolution` and
|
||||
* `numZoomLevels`.
|
||||
* @property {number|undefined} rotation Initial rotation of the view.
|
||||
* @property {number|undefined} zoom Initial zoom level of the view.
|
||||
* @property {number|undefined} rotation Initial rotation of the view.
|
||||
* @property {number|undefined} zoom Initial zoom level of the view.
|
||||
* @property {number|undefined} zoomFactor Factor to calculate resolutions for
|
||||
* zoom levels. Default is 2.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ol.animation.BounceOptions
|
||||
* @property {number} resolution Resolution.
|
||||
* @property {number|undefined} start Start.
|
||||
* @property {number|undefined} duration Duration.
|
||||
* @property {function(number):number|undefined} easing Easing function.
|
||||
* @property {number} resolution Resolution.
|
||||
* @property {number|undefined} start Start.
|
||||
* @property {number|undefined} duration Duration.
|
||||
* @property {function(number):number|undefined} easing Easing function.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
/**
|
||||
* @typedef {Object} ol.control.AttributionOptions
|
||||
* @property {ol.Map|undefined} map Map.
|
||||
* @property {ol.Map|undefined} map Map.
|
||||
* @property {Element|undefined} target Target.
|
||||
*/
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
* @property {number|undefined} contrast Contrast.
|
||||
* @property {number|undefined} hue Hue.
|
||||
* @property {number|undefined} opacity Opacity. 0-1. Default is 1.
|
||||
* @property {number|undefined} preload Preload.
|
||||
* @property {number|undefined} preload Preload.
|
||||
* @property {number|undefined} saturation Saturation.
|
||||
* @property {ol.source.Source} source Source for this layer.
|
||||
* @property {boolean|undefined} visible Visibility. Default is true (visible).
|
||||
@@ -204,7 +204,7 @@
|
||||
* @typedef {Object} ol.layer.VectorLayerOptions
|
||||
* @property {number|undefined} opacity Opacity. 0-1. Default is 1.
|
||||
* @property {ol.source.Source} source Source for this layer.
|
||||
* @property {ol.style.Style|undefined} style Style.
|
||||
* @property {ol.style.Style|undefined} style Style.
|
||||
* @property {boolean|undefined} visible Visibility. Default is true (visible).
|
||||
*/
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
* @property {ol.ProjectionLike} projection Projection.
|
||||
* @property {string|undefined} url WMS service url.
|
||||
* @property {Array.<string>|undefined} urls WMS service urls. Use this instead
|
||||
* of `url` when the WMS supports multiple urls for GetMap requests.
|
||||
* of `url` when the WMS supports multiple urls for GetMap requests.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -350,9 +350,9 @@
|
||||
* @property {string|ol.Expression|undefined} fillColor Fill color as hex color
|
||||
* code.
|
||||
* @property {string|ol.Expression|undefined} strokeColor Stroke color as hex
|
||||
* color code.
|
||||
* color code.
|
||||
* @property {number|ol.Expression|undefined} strokeWidth Stroke width in
|
||||
* pixels.
|
||||
* pixels.
|
||||
* @property {number|ol.Expression|undefined} opacity Opacity (0-1).
|
||||
*/
|
||||
|
||||
@@ -402,4 +402,4 @@
|
||||
/**
|
||||
* @typedef {Object} ol.tilegrid.XYZOptions
|
||||
* @property {number} maxZoom Maximum zoom.
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/**
|
||||
* @namespace ol
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/**
|
||||
* @namespace ol.animation
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/**
|
||||
* @namespace ol.control
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
@exportClass ol.control.Attribution ol.control.AttributionOptions
|
||||
@exportProperty ol.control.Attribution.prototype.setMap
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
@exportClass ol.control.MousePosition ol.control.MousePositionOptions
|
||||
@exportProperty ol.control.MousePosition.prototype.setMap
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
@exportClass ol.control.ZoomSlider ol.control.ZoomSliderOptions
|
||||
@exportClass ol.control.ZoomSlider ol.control.ZoomSliderOptions
|
||||
|
||||
@@ -117,4 +117,3 @@ ol.dom.Input.prototype.handleCheckedChanged_ = function() {
|
||||
ol.dom.Input.prototype.handleValueChanged_ = function() {
|
||||
this.target_.value = this.getValue();
|
||||
};
|
||||
|
||||
|
||||
@@ -39,4 +39,3 @@ ol.filter.Geometry.prototype.applies = function(feature) {
|
||||
ol.filter.Geometry.prototype.getType = function() {
|
||||
return this.type_;
|
||||
};
|
||||
|
||||
|
||||
@@ -160,4 +160,3 @@ ol.geom.SharedVertices.prototype.getStart = function(id) {
|
||||
ol.geom.SharedVertices.prototype.getStarts = function() {
|
||||
return this.starts_;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
@exportSymbol ol.interaction.Keyboard
|
||||
@exportProperty ol.interaction.Keyboard.prototype.addCallback
|
||||
|
||||
|
||||
@@ -8,5 +8,3 @@ goog.provide('ol.IView3D');
|
||||
*/
|
||||
ol.IView3D = function() {
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/**
|
||||
* @namespace ol.layer
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
@exportProperty ol.MapBrowserEvent.prototype.getCoordinate
|
||||
|
||||
|
||||
@@ -61,4 +61,3 @@ ol.parser.ogc.WMSCapabilities_v1_0_0 = function() {
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_0_0,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1_0);
|
||||
|
||||
|
||||
@@ -24,4 +24,3 @@ ol.parser.ogc.WMSCapabilities_v1_1_0 = function() {
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_0,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1);
|
||||
|
||||
|
||||
@@ -20,4 +20,3 @@ ol.parser.ogc.WMSCapabilities_v1_1_1 = function() {
|
||||
};
|
||||
goog.inherits(ol.parser.ogc.WMSCapabilities_v1_1_1,
|
||||
ol.parser.ogc.WMSCapabilities_v1_1);
|
||||
|
||||
|
||||
@@ -439,4 +439,3 @@ ol.renderer.canvas.VectorRenderer.handleIconLoad_ =
|
||||
opt_callback();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/**
|
||||
* @namespace ol.source
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
@exportSymbol ol.source.OpenStreetMap
|
||||
@exportProperty ol.source.OpenStreetMap.DATA_ATTRIBUTION
|
||||
@exportProperty ol.source.OpenStreetMap.TILE_ATTRIBUTION
|
||||
|
||||
|
||||
@@ -210,4 +210,3 @@ ol.structs.RTree.MAX_SUB_DIVISIONS = 6;
|
||||
* @type {number}
|
||||
*/
|
||||
ol.structs.RTree.MAX_OBJECTS = 6;
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/**
|
||||
* @namespace ol.style
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -43,4 +43,3 @@ ol.style.Rule.prototype.applies = function(feature) {
|
||||
ol.style.Rule.prototype.getSymbolizers = function() {
|
||||
return this.symbolizers_;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/**
|
||||
* @namespace ol.tilegrid
|
||||
*/
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user