OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 is_debugger = IsDebuggerFile(source) | 434 is_debugger = IsDebuggerFile(source) |
435 result.is_debugger_id.append(is_debugger) | 435 result.is_debugger_id.append(is_debugger) |
436 | 436 |
437 name = os.path.basename(source)[:-3] | 437 name = os.path.basename(source)[:-3] |
438 result.names.append(name if not is_debugger else name[:-9]) | 438 result.names.append(name if not is_debugger else name[:-9]) |
439 | 439 |
440 for extra in extra_files: | 440 for extra in extra_files: |
441 try: | 441 try: |
442 lines = extra_filters(extra) | 442 lines = extra_filters(extra) |
443 except Error as e: | 443 except Error as e: |
444 raise Error("In file %s:\n%s" % (source, str(e))) | 444 raise Error("In file %s:\n%s" % (extra, str(e))) |
445 | 445 |
446 result.modules.append(lines) | 446 result.modules.append(lines) |
447 name = os.path.basename(source)[:-3] | 447 name = os.path.basename(extra)[:-3] |
448 result.names.append(name) | 448 result.names.append(name) |
449 | 449 |
450 return result | 450 return result |
451 | 451 |
452 | 452 |
453 def BuildMetadata(sources, source_bytes, native_type): | 453 def BuildMetadata(sources, source_bytes, native_type): |
454 """Build the meta data required to generate a libaries file. | 454 """Build the meta data required to generate a libaries file. |
455 | 455 |
456 Args: | 456 Args: |
457 sources: A Sources instance with the prepared sources. | 457 sources: A Sources instance with the prepared sources. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 help="writes a JS file output instead of a C file", | 593 help="writes a JS file output instead of a C file", |
594 action="store_true") | 594 action="store_true") |
595 | 595 |
596 args = vars(parser.parse_args()) | 596 args = vars(parser.parse_args()) |
597 JS2C(args["sources.js"], args["extra"] or [], args["out.cc"], args["type"], ar
gs["raw"], args["startup_blob"], | 597 JS2C(args["sources.js"], args["extra"] or [], args["out.cc"], args["type"], ar
gs["raw"], args["startup_blob"], |
598 args["js"]) | 598 args["js"]) |
599 | 599 |
600 | 600 |
601 if __name__ == "__main__": | 601 if __name__ == "__main__": |
602 main() | 602 main() |
OLD | NEW |