Update build tools to make it possible to build a 'lite' version of the single file library.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1594 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-10-05 15:53:41 +00:00
parent 0da08584d8
commit deb64d31fe
4 changed files with 36 additions and 6 deletions

View File

@@ -9,7 +9,11 @@ TMP_OUTPUT_FILENAME=tmp.${OUTPUT_FILENAME}
TOOLS_DIR=../tools
if [ "$1" != "" ]; then
CFG_FILENAME="$1.cfg"
else
CFG_FILENAME=library.cfg
fi
SRC_DIR=../lib

View File

@@ -1,11 +1,13 @@
[first]
Prototype.js
Rico/Corner.js
OpenLayers/SingleFile.js
OpenLayers.js
OpenLayers/BaseTypes.js
Rico/Corner.js
[last]
[include]
[exclude]
OpenLayers/Layer/Yahoo.js
OpenLayers/Control/KeyboardDefaults.js

20
build/lite.cfg Normal file
View File

@@ -0,0 +1,20 @@
[first]
OpenLayers/SingleFile.js
OpenLayers.js
OpenLayers/BaseTypes.js
OpenLayers/Util.js
[last]
[include]
OpenLayers/Events.js
OpenLayers/Map.js
OpenLayers/Layer.js
OpenLayers/Layer/Grid.js
OpenLayers/Layer/HTTPRequest.js
OpenLayers/Layer/WMS.js
OpenLayers/Layer/WMS/Untiled.js
OpenLayers/Tile.js
OpenLayers/Tile/Image.js
[exclude]

View File

@@ -123,8 +123,8 @@ class Config:
self.forceFirst = lines[lines.index("[first]") + 1:lines.index("[last]")]
self.forceLast = lines[lines.index("[last]") + 1:lines.index("[exclude]")]
self.forceLast = lines[lines.index("[last]") + 1:lines.index("[include]")]
self.include = lines[lines.index("[include]") + 1:lines.index("[exclude]")]
self.exclude = lines[lines.index("[exclude]") + 1:]
if __name__ == "__main__":
@@ -150,6 +150,7 @@ if __name__ == "__main__":
cfg = Config(filename)
print cfg.include
allFiles = []
## Find all the Javascript source files
@@ -157,7 +158,10 @@ if __name__ == "__main__":
for filename in files:
if filename.endswith(SUFFIX_JAVASCRIPT) and not filename.startswith("."):
filepath = os.path.join(root, filename)[len(sourceDirectory)+1:]
if (not cfg) or (filepath not in cfg.exclude):
if cfg and cfg.include:
if filepath in cfg.include or filepath in cfg.forceFirst:
allFiles.append(filepath)
elif (not cfg) or (filepath not in cfg.exclude):
allFiles.append(filepath)
## Header inserted at the start of each file in the output