OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import glob | 3 import glob |
4 import os | 4 import os |
5 import os.path | 5 import os.path |
6 import platform | 6 import platform |
7 import re | 7 import re |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 print 'Converting %s to %s' % (tail, outfilename) | 56 print 'Converting %s to %s' % (tail, outfilename) |
57 for line in infile: | 57 for line in infile: |
58 result = re.search(pattern, line) | 58 result = re.search(pattern, line) |
59 if result: | 59 if result: |
60 testname = result.group(1) | 60 testname = result.group(1) |
61 dartname = testname + '.dart' | 61 dartname = testname + '.dart' |
62 jsname = '%s.%s.js' % (testname, compiler) | 62 jsname = '%s.%s.js' % (testname, compiler) |
63 outname = os.path.join(outdir, jsname) | 63 outname = os.path.join(outdir, jsname) |
64 Compile(dartname, outname, compiler) | 64 Compile(dartname, outname, compiler) |
65 script = '<script type="text/javascript" src="%s" defer>' % jsname | 65 script = '<script type="text/javascript" src="%s">' % jsname |
66 outfile.write(re.sub(pattern, script, line)) | 66 outfile.write(re.sub(pattern, script, line)) |
67 else: | 67 else: |
68 outfile.write(line) | 68 outfile.write(line) |
69 | 69 |
70 if head == 'tests': | 70 if head == 'tests': |
71 os.chdir('..') | 71 os.chdir('..') |
72 | 72 |
73 # Compile individual html tests. | 73 # Compile individual html tests. |
74 tests = glob.glob('tests/dom-*-html.html') | 74 tests = glob.glob('tests/dom-*-html.html') |
75 | 75 |
76 for test in tests: | 76 for test in tests: |
77 HtmlConvert(test, 'dart2js') | 77 HtmlConvert(test, 'dart2js') |
78 | 78 |
79 # Compile driver to index-js.html. | 79 # Compile driver to index-js.html. |
80 HtmlConvert('index.html', 'dart2js') | 80 HtmlConvert('index.html', 'dart2js') |
OLD | NEW |