From deb64d31feaa898789ea8eac5de556dcb01d892d Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Thu, 5 Oct 2006 15:53:41 +0000 Subject: [PATCH] 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 --- build/build.sh | 6 +++++- build/library.cfg | 6 ++++-- build/lite.cfg | 20 ++++++++++++++++++++ tools/mergejs.py | 10 +++++++--- 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 build/lite.cfg diff --git a/build/build.sh b/build/build.sh index 38eaf02acf..b5435a2268 100755 --- a/build/build.sh +++ b/build/build.sh @@ -9,7 +9,11 @@ TMP_OUTPUT_FILENAME=tmp.${OUTPUT_FILENAME} TOOLS_DIR=../tools -CFG_FILENAME=library.cfg +if [ "$1" != "" ]; then + CFG_FILENAME="$1.cfg" +else + CFG_FILENAME=library.cfg +fi SRC_DIR=../lib diff --git a/build/library.cfg b/build/library.cfg index 7905f73fdc..e37808a6f2 100644 --- a/build/library.cfg +++ b/build/library.cfg @@ -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 diff --git a/build/lite.cfg b/build/lite.cfg new file mode 100644 index 0000000000..4518c475a6 --- /dev/null +++ b/build/lite.cfg @@ -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] diff --git a/tools/mergejs.py b/tools/mergejs.py index 595e0ce58e..a558b0f905 100755 --- a/tools/mergejs.py +++ b/tools/mergejs.py @@ -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