OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 Google Inc. | 3 # Copyright 2015 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 # This script does a very rough simulation of BUILD file expansion, | 8 # This script does a very rough simulation of BUILD file expansion, |
9 # mostly to see the effects of glob(). | 9 # mostly to see the effects of glob(). |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 # With these namespaces, we can treat BUILD.public as if it were | 70 # With these namespaces, we can treat BUILD.public as if it were |
71 # Python code. This pulls its variable definitions (SRCS, HDRS, | 71 # Python code. This pulls its variable definitions (SRCS, HDRS, |
72 # DEFINES, etc.) into local_names. | 72 # DEFINES, etc.) into local_names. |
73 global_names = { | 73 global_names = { |
74 'cc_library': noop, | 74 'cc_library': noop, |
75 'cc_test': noop, | 75 'cc_test': noop, |
76 'exports_files': noop, | 76 'exports_files': noop, |
77 'glob': BUILD_glob, | 77 'glob': BUILD_glob, |
78 'select': select_simulator, | 78 'select': select_simulator, |
79 'BASE_DIR': "", | 79 'BASE_DIR': '', |
80 'CONDITION_ANDROID': "CONDITION_ANDROID", | 80 'BASE_EXTERNAL_DEPS_ANDROID': [], |
| 81 'BASE_EXTERNAL_DEPS_IOS': [], |
| 82 'BASE_EXTERNAL_DEPS_UNIX': [], |
| 83 'CONDITION_ANDROID': 'CONDITION_ANDROID', |
| 84 'CONDITION_IOS': 'CONDITION_IOS', |
81 'DM_EXTERNAL_DEPS': [], | 85 'DM_EXTERNAL_DEPS': [], |
82 'EXTERNAL_DEPS_ALL': [], | 86 'EXTERNAL_DEPS_ALL': [], |
83 'EXTERNAL_DEPS_ANDROID': [], | |
84 'EXTERNAL_DEPS_UNIX': [], | |
85 } | 87 } |
86 local_names = {} | 88 local_names = {} |
87 execfile('BUILD.public', global_names, local_names) | 89 execfile('BUILD.public', global_names, local_names) |
88 | 90 |
89 with open('tools/BUILD.public.expected', 'w') as out: | 91 with open('tools/BUILD.public.expected', 'w') as out: |
90 print >>out, "This file is auto-generated by tools/BUILD_simulator.py." | 92 print >>out, "This file is auto-generated by tools/BUILD_simulator.py." |
91 print >>out, "It expands BUILD.public to make it easy to see changes." | 93 print >>out, "It expands BUILD.public to make it easy to see changes." |
92 for name, value in sorted(local_names.items()): | 94 for name, value in sorted(local_names.items()): |
93 print >>out, name, '= ', | 95 print >>out, name, '= ', |
94 pprint.pprint(value, out) | 96 pprint.pprint(value, out) |
OLD | NEW |