forked from 0x2620/oxjs
use minify in build script; add unicode module
This commit is contained in:
parent
6b2d26e950
commit
66b9d41450
331 changed files with 114865 additions and 147253 deletions
|
|
@ -1,8 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
#vim: et:ts=4:sw=4:sts=4
|
||||
|
||||
import base64
|
||||
import json
|
||||
import os
|
||||
import ox
|
||||
import re
|
||||
import shutil
|
||||
|
||||
|
|
@ -87,6 +89,10 @@ for path, dirnames, filenames in os.walk(source_path):
|
|||
files.append(target.replace(build_path, ''))
|
||||
write_link(source, target)
|
||||
|
||||
# Ox.js
|
||||
js = read_file(source_path + 'Ox.js');
|
||||
write_file(build_path + 'Ox.min.js', ox.js.minify(js, 'OxJS (c) 2011 0x2620, dual-licensed GPL/MIT, see http://oxjs.org for details'))
|
||||
|
||||
# Ox.UI
|
||||
js = ''
|
||||
section = ''
|
||||
|
|
@ -97,13 +103,7 @@ for path, dirnames, filenames in os.walk(root):
|
|||
if path != root and not '_' in path and not filename[0] in '._' and filename[-4:] != '.css' and filename[-4:] != '.svg' and filename[:7] != 'browser':
|
||||
files.append(os.path.join(path.replace(source_path, ''), filename))
|
||||
if filename[-3:] == '.js':
|
||||
folder = os.path.split(path)[-1]
|
||||
if section != folder:
|
||||
section = folder
|
||||
js += '/*\n' + '=' * 80 + '\n' + section + '\n' + '=' * 80 + '\n*/\n\n'
|
||||
js += '/*\n' + '-' * 80 + '\n' + filename[:-3] + '\n' + '-' * 80 + '\n*/\n\n'
|
||||
js += read_file(os.path.join(path, filename)) + '\n\n'
|
||||
|
||||
write_file(build_path + 'Ox.UI/js/Ox.UI.js', js)
|
||||
js += read_file(os.path.join(path, filename)) + '\n'
|
||||
write_file(build_path + 'Ox.UI/js/Ox.UI.min.js', ox.js.minify(js, 'OxJS (c) 2011 0x2620, dual-licensed GPL/MIT, see http://oxjs.org for details'))
|
||||
files = json.dumps(sorted(files), indent=4, sort_keys=True)
|
||||
write_file(build_path + 'Ox.UI/json/Ox.UI.files.json', files)
|
||||
Loading…
Add table
Add a link
Reference in a new issue