Merge pull request #265 from twpayne/check-requires-in-specs

Check requires in specs
This commit is contained in:
Tom Payne
2013-03-04 11:31:37 -08:00
14 changed files with 25 additions and 3 deletions

View File

@@ -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)

View File

@@ -71,3 +71,5 @@ describe('ol.Color', function() {
});
});
goog.require('ol.Color');

View File

@@ -388,4 +388,5 @@ describe('ol.Ellipsoid', function() {
goog.require('ol.Coordinate');
goog.require('ol.Ellipsoid');
goog.require('ol.ellipsoid.WGS84');

View File

@@ -100,5 +100,6 @@ describe('ol.Extent', function() {
});
});
goog.require('ol.Coordinate');
goog.require('ol.Extent');
goog.require('ol.projection');

View File

@@ -276,4 +276,6 @@ describe('ol.layer.Layer', function() {
});
goog.require('ol.layer.Layer');
goog.require('ol.projection');
goog.require('ol.source.Source');

View File

@@ -187,3 +187,5 @@ describe('ol.structs.LRUCache', function() {
});
});
goog.require('ol.structs.LRUCache');

View File

@@ -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');

View File

@@ -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');

View File

@@ -46,4 +46,5 @@ describe('ol.projection.EPSG3857', function() {
goog.require('ol.Coordinate');
goog.require('ol.projection');
goog.require('ol.projection.EPSG3857');

View File

@@ -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');

View File

@@ -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');

View File

@@ -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');

View File

@@ -68,3 +68,6 @@ describe('ol.TileQueue', function() {
});
});
goog.require('ol.Coordinate');
goog.require('ol.Tile');
goog.require('ol.TileQueue');

View File

@@ -131,4 +131,5 @@ describe('ol.TileRange', function() {
});
goog.require('ol.TileCoord');
goog.require('ol.TileRange');