|
7 | 7 |
|
8 | 8 | # Generate Android.bp for Skia from GN configuration. |
9 | 9 |
|
| 10 | +from __future__ import print_function |
| 11 | + |
10 | 12 | import os |
11 | 13 | import pprint |
12 | 14 | import string |
@@ -442,13 +444,13 @@ def disallow_platforms(config, desired): |
442 | 444 | s += ' || ' |
443 | 445 | if i % 2 == 1: |
444 | 446 | s += '\\\n ' |
445 | | - print >>f, s |
446 | | - print >>f, ' #error "Only SK_BUILD_FOR_%s should be defined!"' % desired |
447 | | - print >>f, '#endif' |
| 447 | + print(s, file=f) |
| 448 | + print(' #error "Only SK_BUILD_FOR_%s should be defined!"' % desired, file=f) |
| 449 | + print('#endif', file=f) |
448 | 450 |
|
449 | 451 | def append_to_file(config, s): |
450 | 452 | with open(config, 'a') as f: |
451 | | - print >>f, s |
| 453 | + print(s, file=f) |
452 | 454 |
|
453 | 455 | android_config = 'android/include/config/SkUserConfig.h' |
454 | 456 | gn_to_bp_utils.WriteUserConfig(android_config, android_defines) |
@@ -483,7 +485,7 @@ def bpfmt(indent, lst, sort=True): |
483 | 485 |
|
484 | 486 | # OK! We have everything to fill in Android.bp... |
485 | 487 | with open('Android.bp', 'w') as Android_bp: |
486 | | - print >>Android_bp, bp.substitute({ |
| 488 | + print(bp.substitute({ |
487 | 489 | 'export_includes': bpfmt(8, export_includes), |
488 | 490 | 'local_includes': bpfmt(8, local_includes), |
489 | 491 | 'srcs': bpfmt(8, srcs), |
@@ -512,4 +514,4 @@ def bpfmt(indent, lst, sort=True): |
512 | 514 | 'linux_srcs': bpfmt(10, linux_srcs), |
513 | 515 | 'mac_srcs': bpfmt(10, mac_srcs), |
514 | 516 | 'win_srcs': bpfmt(10, win_srcs), |
515 | | - }) |
| 517 | + }), file=Android_bp) |
0 commit comments