Changeset 219289 in webkit for trunk/Source/JavaScriptCore/Scripts
- Timestamp:
- Jul 10, 2017, 6:19:55 AM (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/Scripts/make-js-file-arrays.py
r219288 r219289 42 42 43 43 def main(): 44 parser = OptionParser(usage="usage: %prog [ --no-minify] header source [input [input...]]")44 parser = OptionParser(usage="usage: %prog [options] header source [input [input...]]") 45 45 parser.add_option('--no-minify', action='store_true', help='Do not run the input files through jsmin') 46 parser.add_option('-n', '--namespace', help='Namespace to use') 46 47 (options, arguments) = parser.parse_args() 48 if not options.namespace: 49 print 'Error: must provide a namespace' 50 parser.print_usage() 51 exit(-1) 47 52 if len(arguments) < 3: 48 53 print 'Error: must provide at least 3 arguments' … … 50 55 exit(-1) 51 56 57 namespace = options.namespace 52 58 headerPath = arguments[0] 53 59 sourcePath = arguments[1] … … 55 61 56 62 headerFile = open(headerPath, 'w') 57 print >> headerFile, 'namespace WebCore {'63 print >> headerFile, 'namespace {0:s} {{'.format(namespace) 58 64 59 65 sourceFile = open(sourcePath, 'w') 60 66 print >> sourceFile, '#include "{0:s}"'.format(os.path.basename(headerPath)) 61 print >> sourceFile, 'namespace WebCore {'67 print >> sourceFile, 'namespace {0:s} {{'.format(namespace) 62 68 63 69 jsm = JavascriptMinify() … … 85 91 print >> sourceFile, '};' 86 92 87 print >> headerFile, '} '88 print >> sourceFile, '} '93 print >> headerFile, '}} // namespace {0:s}'.format(namespace) 94 print >> sourceFile, '}} // namespace {0:s}'.format(namespace) 89 95 90 96 if __name__ == '__main__':
Note:
See TracChangeset
for help on using the changeset viewer.