Skip to content

Commit

Permalink
Add patch to build tools to allow comments in build profiles. patch from
Browse files Browse the repository at this point in the history
jwpage, r=me (Closes #1541)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@8979 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
  • Loading branch information
crschmidt committed Mar 10, 2009
1 parent 861ef81 commit fe20406
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions build/full.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This is the full build with all files: this includes the vector-related files
# like Renderers and Formats.

[first]
OpenLayers/SingleFile.js
OpenLayers.js
Expand Down
4 changes: 4 additions & 0 deletions build/library.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file includes the OpenLayers code to create a build for everything that
# does not require vector support. build.py uses this profile if no other one
# is specified.

[first]
OpenLayers/SingleFile.js
OpenLayers.js
Expand Down
6 changes: 6 additions & 0 deletions build/lite.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# This file includes a small subset of OpenLayers code, designed to be
# integrated into another application. It includes only the Layer types
# neccesary to create tiled or untiled WMS, and does not include any Controls.
# This is the result of what was at the time called "Webmap.js" at the FOSS4G
# Web Mapping BOF.

[first]
OpenLayers/SingleFile.js
OpenLayers.js
Expand Down
9 changes: 6 additions & 3 deletions tools/mergejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ class Config:
3rd/prototype.js
core/application.js
core/params.js
# A comment
[last]
core/api.js
core/api.js # Another comment
[exclude]
3rd/logger.js
Expand All @@ -102,16 +103,18 @@ class Config:
order listed).
The files list in the `exclude` section will not be imported.
Any text appearing after a # symbol indicates a comment.
"""

def __init__(self, filename):
"""
Parses the content of the named file and stores the values.
"""
lines = [line.strip() # Assumes end-of-line character is present
lines = [re.sub("#.*?$", "", line).strip() # Assumes end-of-line character is present
for line in open(filename)
if line.strip()] # Skip blank lines
if line.strip() and not line.strip().startswith("#")] # Skip blank lines and comments

self.forceFirst = lines[lines.index("[first]") + 1:lines.index("[last]")]

Expand Down

0 comments on commit fe20406

Please sign in to comment.