Chromium Code Reviews| 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 re | 6 import re |
| 7 import subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 SAMPLES_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(_ _file__)))) | 10 SAMPLES_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(_ _file__)))) |
| 11 DART_PATH = os.path.dirname(SAMPLES_PATH) | 11 DART_PATH = os.path.dirname(SAMPLES_PATH) |
| 12 TOOLS_PATH = os.path.join(DART_PATH, 'tools') | 12 TOOLS_PATH = os.path.join(DART_PATH, 'tools') |
| 13 | 13 |
| 14 sys.path.append(TOOLS_PATH) | 14 sys.path.append(TOOLS_PATH) |
| 15 import utils | 15 import utils |
| 16 | 16 |
| 17 def Compile(source, target): | 17 def Compile(source, target): |
| 18 binary = os.path.abspath(os.path.join(DART_PATH, | 18 binary = os.path.abspath(os.path.join(DART_PATH, |
| 19 utils.GetBuildRoot(utils.GuessOS(), | 19 utils.GetBuildRoot(utils.GuessOS(), |
| 20 'release', 'ia32'), | 20 'release', 'ia32'), |
| 21 'frog', 'bin', 'frogsh')) | 21 'dart-sdk', 'bin', 'frogc')) |
|
Emily Fortuna
2012/04/02 21:27:41
The reason I was getting a File not Found for thes
vsm
2012/04/02 22:16:19
Thanks for the catch. Added a makedirs if the pat
| |
| 22 | 22 |
| 23 cmd = [binary, '--compile-only', | 23 cmd = [binary, '--compile-only', |
| 24 '--libdir=' + os.path.join(DART_PATH, 'frog', 'lib'), | |
| 25 '--out=' + target] | 24 '--out=' + target] |
| 26 cmd.append(source) | 25 cmd.append(source) |
| 27 print 'Executing: ' + ' '.join(cmd) | 26 print 'Executing: ' + ' '.join(cmd) |
| 28 subprocess.call(cmd) | 27 subprocess.call(cmd) |
| 29 | 28 |
| 30 def HtmlConvert(infile): | 29 def HtmlConvert(infile): |
| 31 (head, tail) = os.path.split(infile) | 30 (head, tail) = os.path.split(infile) |
| 32 | 31 |
| 33 if head == 'tests': | 32 if head == 'tests': |
| 34 outdir = 'frog' | 33 outdir = 'frog' |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 59 os.chdir('..') | 58 os.chdir('..') |
| 60 | 59 |
| 61 # Frog compile individual dom and html tests into tests/frog. | 60 # Frog compile individual dom and html tests into tests/frog. |
| 62 tests = glob.glob('tests/dom-*-*.html') | 61 tests = glob.glob('tests/dom-*-*.html') |
| 63 | 62 |
| 64 for test in tests: | 63 for test in tests: |
| 65 HtmlConvert(test) | 64 HtmlConvert(test) |
| 66 | 65 |
| 67 # Frog compile driver to index-js.html. | 66 # Frog compile driver to index-js.html. |
| 68 HtmlConvert('index.html') | 67 HtmlConvert('index.html') |
| OLD | NEW |