add bzr revision to version

This commit is contained in:
j 2012-03-30 23:12:00 +02:00
parent 7294662868
commit 3be78a965a

View file

@ -7,6 +7,7 @@ import os
import ox import ox
import re import re
import shutil import shutil
import subprocess
import sys import sys
@ -19,8 +20,11 @@ def build_oxjs(geo):
source_path = '../../source/' source_path = '../../source/'
build_path = '../../build/' build_path = '../../build/'
dev_path = '../../dev/' dev_path = '../../dev/'
comment = 'OxJS (c) 2012 0x2620, dual-licensed GPL/MIT, see http://oxjs.org for details' version = '0.1.%s' % subprocess.Popen(
['bzr', 'revno'],
stdout=subprocess.PIPE
).communicate()[0].strip()
comment = 'OxJS %s (c) 2012 0x2620, dual-licensed GPL/MIT, see http://oxjs.org for details' % version
# SVGs # SVGs
path = source_path + 'Ox.UI/themes/classic/svg/' path = source_path + 'Ox.UI/themes/classic/svg/'
for filename in os.listdir(path): for filename in os.listdir(path):
@ -100,6 +104,7 @@ def build_oxjs(geo):
js += read_file(source_path + js_dir + filename) + '\n' js += read_file(source_path + js_dir + filename) + '\n'
if not js_dir + filename in data[0] + data[1]: if not js_dir + filename in data[0] + data[1]:
data[2].append(js_dir + filename) data[2].append(js_dir + filename)
js = js.replace("Ox.VERSION = '0.1.2';", "Ox.VERSION = '%s';" % version)
write_file(build_path + 'Ox.js', ox.js.minify(js, comment)) write_file(build_path + 'Ox.js', ox.js.minify(js, comment))
write_file(dev_path + '/Ox/json/' + 'Ox.json', json.dumps(data, indent=4)) write_file(dev_path + '/Ox/json/' + 'Ox.json', json.dumps(data, indent=4))