build.py: update dependencies, and make sure the list of lists of scripts can have an arbitrary length

This commit is contained in:
rolux 2012-09-03 22:28:37 +02:00
parent e50d4c22db
commit e569af5369

View file

@ -98,23 +98,20 @@ def build_oxjs(downloads=False, geo=False):
'Core.js' # has to run first so that Ox is defined 'Core.js' # has to run first so that Ox is defined
], ],
[ [
'Array.js', # Ox.PATH depends on Ox.toArray 'Function.js', # getSortValue (Array.js) depends on Ox.cache
'Collection.js', # Ox.toArray depends on Ox.slice 'Math.js', # Ox.MAX_LATITUDE (Constants.js) depends on Ox.sinh
'Polyfill.js', # FIXME: not clear if needed here 'Polyfill.js', # FIXME: not clear if needed here
'Math.js', # Ox.MAX_LATITUDE depends on Ox.sinh
'Object.js', # Ox.typeOf depends on Ox.hasOwn
'String.js', # HTML.js depends on Ox.char
'Type.js' # Ox.slice may depend on Ox.typeOf
] ]
] ]
js = '' js = ''
js_dir = 'Ox/js/' js_dir = 'Ox/js/'
ox_files = [[], [], []] ox_files = []
for filename in filenames[0]: for group in filenames:
ox_files[0].append(js_dir + filename) ox_files.append([])
for filename in filenames[1]: for filename in group:
ox_files[1].append(js_dir + filename) ox_files[-1].append(js_dir + filename)
filenames = filenames[0] + filenames[1] ox_files.append([])
filenames = sum(filenames, []) # flatten
for filename in sorted(os.listdir(source_path + js_dir)): for filename in sorted(os.listdir(source_path + js_dir)):
if not filename in filenames \ if not filename in filenames \
and not filename.startswith('.') \ and not filename.startswith('.') \
@ -122,8 +119,8 @@ def build_oxjs(downloads=False, geo=False):
filenames.append(filename) filenames.append(filename)
for filename in filenames: for filename in filenames:
js += read_file(source_path + js_dir + filename) + '\n' js += read_file(source_path + js_dir + filename) + '\n'
if not js_dir + filename in ox_files[0] + ox_files[1]: if not js_dir + filename in sum(ox_files, []):
ox_files[2].append(js_dir + filename) ox_files[-1].append(js_dir + filename)
js = re.sub("Ox.VERSION = '([\d\.]+)'", "Ox.VERSION = '%s'" % version, js) js = re.sub("Ox.VERSION = '([\d\.]+)'", "Ox.VERSION = '%s'" % version, js)
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({ write_file(dev_path + '/Ox/json/' + 'Ox.json', json.dumps({