Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: client/tools/htmlconverter.py

Issue 8590039: Add libdir when invoking frog. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 #!/usr/bin/env python 5 #!/usr/bin/env python
6 # 6 #
7 7
8 """Rewrites HTML files, converting Dart script sections into JavaScript. 8 """Rewrites HTML files, converting Dart script sections into JavaScript.
9 9
10 Process HTML files, and internally changes script sections that use Dart code 10 Process HTML files, and internally changes script sections that use Dart code
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 '--work', outdir, 183 '--work', outdir,
184 '--out', self.outputFileName(inputfile, outdir)] 184 '--out', self.outputFileName(inputfile, outdir)]
185 if self.optimize: 185 if self.optimize:
186 cmd.append('--optimize') 186 cmd.append('--optimize')
187 else: 187 else:
188 binary = abspath(join(DART_PATH, 'frog', 188 binary = abspath(join(DART_PATH, 'frog',
189 utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32'), 189 utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32'),
190 'frog', 'bin', 'frogsh')) 190 'frog', 'bin', 'frogsh'))
191 if not exists(binary): 191 if not exists(binary):
192 raise ConverterException(FROG_NOT_FOUND_ERROR % DART_PATH) 192 raise ConverterException(FROG_NOT_FOUND_ERROR % DART_PATH)
193 cmd = [binary, '--compile-only', 193 cmd = [binary, '--compile-only',
194 '--libdir=' + join(DART_PATH, 'frog', 'lib'),
194 '--out=' + self.outputFileName(inputfile, outdir)] 195 '--out=' + self.outputFileName(inputfile, outdir)]
195 if self.extra_flags != "": 196 if self.extra_flags != "":
196 cmd.append(self.extra_flags); 197 cmd.append(self.extra_flags);
197 cmd.append(inputfile) 198 cmd.append(inputfile)
198 return cmd 199 return cmd
199 200
200 def outputFileName(self, inputfile, outdir): 201 def outputFileName(self, inputfile, outdir):
201 return join(outdir, basename(inputfile) + '.js') 202 return join(outdir, basename(inputfile) + '.js')
202 203
203 def execute(cmd, verbose=False): 204 def execute(cmd, verbose=False):
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if 'dartium' in options.target: 583 if 'dartium' in options.target:
583 convertForDartium(filename, options.out, 584 convertForDartium(filename, options.out,
584 outfile.replace(extension, '-dart' + extension), options.verbose) 585 outfile.replace(extension, '-dart' + extension), options.verbose)
585 except Exception as e: 586 except Exception as e:
586 print "%sERROR%s: %s" % (RED_COLOR, NO_COLOR, str(e)) 587 print "%sERROR%s: %s" % (RED_COLOR, NO_COLOR, str(e))
587 return 1 588 return 1
588 return 0 589 return 0
589 590
590 if __name__ == '__main__': 591 if __name__ == '__main__':
591 sys.exit(main()) 592 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698