diff options
| author | Pete Gillin <peteg@google.com> | 2018-08-21 15:14:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-08-21 15:14:55 +0000 |
| commit | c9b1c31bf84b1b0d174e99585f3b3d2a415a8f7f (patch) | |
| tree | e7d45500447df3c6f19a15a968251a0633e30781 /annotations/generate_annotated_java_files.py | |
| parent | 5dfab1977c18fe6fc6e2c0ce632a26f588e0ca9a (diff) | |
| parent | 5b5ebf32eba5855e7d810827fb5de9bf22a38325 (diff) | |
Merge "Remove ojluni.jaif and associated machinery."
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
| -rwxr-xr-x | annotations/generate_annotated_java_files.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/annotations/generate_annotated_java_files.py b/annotations/generate_annotated_java_files.py deleted file mode 100755 index 2f12eea105..0000000000 --- a/annotations/generate_annotated_java_files.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python - -"""Generate annotated_java_files.bp from a jaif file.""" -import os - -PACKAGE_STRING = 'package ' -CLASS_STRING = 'class ' -SRC_PREFIX = 'ojluni/src/main/java/' - -BP_TEMPLATE = '''filegroup { - name: "annotated_ojluni_files", - export_to_make_var: "annotated_ojluni_files", - srcs: [ -%s - ], -}''' - -srcs_list = set() -current_package = None -with open(os.sys.argv[1], 'r') as jaif_file: - for line in jaif_file: - if line.startswith(PACKAGE_STRING): - current_package = line[len(PACKAGE_STRING): line.find(':')] - if line.startswith(CLASS_STRING) and current_package is not None: - current_class = line[len(CLASS_STRING): line.find(':')] - - # In case of nested classes, discard substring after nested class name separator - nested_class_separator_index = current_class.find('$') - if nested_class_separator_index != -1: - current_class = current_class[:nested_class_separator_index] - - srcs_list.add(SRC_PREFIX + current_package.replace('.', '/') + '/' + current_class + '.java') - -print '// Do not edit; generated using libcore/annotations/generate_annotated_java_files.py' -print BP_TEMPLATE % ('\n'.join([' "' + src_entry + '",' for src_entry in sorted(srcs_list)]),) -os.sys.exit(0) |
