Merge pull request #265 from twpayne/check-requires-in-specs
Check requires in specs
This commit is contained in:
6
build.py
6
build.py
@@ -263,7 +263,7 @@ def _strip_comments(lines):
|
||||
yield line
|
||||
|
||||
|
||||
@target('build/check-requires-timestamp', SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC)
|
||||
@target('build/check-requires-timestamp', SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC, SPEC)
|
||||
def build_check_requires_timestamp(t):
|
||||
unused_count = 0
|
||||
all_provides = set()
|
||||
@@ -273,7 +273,8 @@ def build_check_requires_timestamp(t):
|
||||
require_linenos = {}
|
||||
uses = set()
|
||||
lineno = 0
|
||||
for line in open(filename):
|
||||
lines = open(filename).readlines()
|
||||
for line in lines:
|
||||
lineno += 1
|
||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
||||
if m:
|
||||
@@ -283,6 +284,7 @@ def build_check_requires_timestamp(t):
|
||||
if m:
|
||||
require_linenos[m.group(1)] = lineno
|
||||
continue
|
||||
for line in lines:
|
||||
for require in require_linenos.iterkeys():
|
||||
if require in line:
|
||||
uses.add(require)
|
||||
|
||||
@@ -71,3 +71,5 @@ describe('ol.Color', function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.Color');
|
||||
|
||||
@@ -388,4 +388,5 @@ describe('ol.Ellipsoid', function() {
|
||||
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Ellipsoid');
|
||||
goog.require('ol.ellipsoid.WGS84');
|
||||
|
||||
@@ -100,5 +100,6 @@ describe('ol.Extent', function() {
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.projection');
|
||||
|
||||
@@ -276,4 +276,6 @@ describe('ol.layer.Layer', function() {
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.source.Source');
|
||||
|
||||
@@ -187,3 +187,5 @@ describe('ol.structs.LRUCache', function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.structs.LRUCache');
|
||||
|
||||
@@ -246,6 +246,9 @@ goog.require('ol.Collection');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.interaction.DblClickZoom');
|
||||
goog.require('ol.interaction.MouseWheelZoom');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
@@ -178,4 +178,5 @@ describe('ol.parser.ogc.wmtscapabilities_v1_0_0', function() {
|
||||
});
|
||||
|
||||
goog.require('goog.net.XhrIo');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.parser.ogc.WMTSCapabilities');
|
||||
|
||||
@@ -46,4 +46,5 @@ describe('ol.projection.EPSG3857', function() {
|
||||
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.projection.EPSG3857');
|
||||
|
||||
@@ -78,6 +78,7 @@ describe('ol.renderer.webgl.ImageLayer', function() {
|
||||
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('goog.vec.Vec4');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.Image');
|
||||
goog.require('ol.Map');
|
||||
|
||||
@@ -227,12 +227,13 @@ describe('ol.test.source.MockTileSource', function() {
|
||||
});
|
||||
|
||||
goog.require('goog.object');
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileState');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.source.Source');
|
||||
goog.require('ol.source.TileSource');
|
||||
goog.require('ol.tilegrid.TileGrid');
|
||||
|
||||
@@ -130,4 +130,5 @@ describe('ol.source.XYZ', function() {
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileUrlFunction');
|
||||
goog.require('ol.tilegrid.XYZ');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
@@ -68,3 +68,6 @@ describe('ol.TileQueue', function() {
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.TileQueue');
|
||||
|
||||
@@ -131,4 +131,5 @@ describe('ol.TileRange', function() {
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileRange');
|
||||
|
||||
Reference in New Issue
Block a user