summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-09 21:30:09 -0500
committerEliot Horowitz <eliot@10gen.com>2009-12-09 21:30:09 -0500
commit32d56f6d81a98b569103149c9ffea9f25a1ece81 (patch)
tree7ddea2c544f637cfae765f7156419ebbd92f923a /SConstruct
parenta4a4fc0a58e71a62e7fe757e9f03128ba44d0451 (diff)
downloadmongo-32d56f6d81a98b569103149c9ffea9f25a1ece81.tar.gz
strip comments from javascript
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct17
1 files changed, 16 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index f94c14b7533..50ea9bde21e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -862,6 +862,8 @@ def concatjs(target, source, env):
fullSource = ""
+ first = True
+
for s in source:
f = open( str(s) , 'r' )
for l in f:
@@ -869,8 +871,21 @@ def concatjs(target, source, env):
if len ( l ) == 0:
continue
- fullSource += l + "\n"
+ if l == "}":
+ fullSource += "}"
+ continue
+
+ if first:
+ first = False
+ else:
+ fullSource += "\n"
+
+ fullSource += l
+
+ fullSource += "\n"
+ fullSource = re.compile( r'/\*\*.*?\*/' , re.M | re.S ).sub( "" , fullSource )
+
out = open( outFile , 'w' )
out.write( fullSource )