Rename # vndk tag to # llndk
The APIs that are tagged with # vndk are actually for LLNDK libraries.
Although LLNDK is part of VNDK, calling those APIs 'vndk' has given
users a wrong perception that the APIs don't need to be kept stable
because that's the norm for most of the VNDK libraries that are not
LLNDK.
In order to eliminate the misunderstanding, rename the tag to 'llndk' so
that people introducing new such API will realize what they are signing
themselves up for.
Exempt-From-Owner-Approval: cherry-pick from internal gerrit
Bug: 143765505
Test: m
Test: python3 test_gen_stub_libs.py
Merged-In: I2853df3b6e245056c21d4ab3d62466954cf26d72
(cherry picked from commit 3d7b69a657c7baea8c14bec52aaeaed975cfc300)
Change-Id: I2853df3b6e245056c21d4ab3d62466954cf26d72
diff --git a/cc/gen_stub_libs.py b/cc/gen_stub_libs.py
index 81bc398..0de703c 100755
--- a/cc/gen_stub_libs.py
+++ b/cc/gen_stub_libs.py
@@ -108,7 +108,7 @@
return version.endswith('_PRIVATE') or version.endswith('_PLATFORM')
-def should_omit_version(version, arch, api, vndk, apex):
+def should_omit_version(version, arch, api, llndk, apex):
"""Returns True if the version section should be ommitted.
We want to omit any sections that do not have any symbols we'll have in the
@@ -120,9 +120,9 @@
if 'platform-only' in version.tags:
return True
- no_vndk_no_apex = 'vndk' not in version.tags and 'apex' not in version.tags
- keep = no_vndk_no_apex or \
- ('vndk' in version.tags and vndk) or \
+ no_llndk_no_apex = 'llndk' not in version.tags and 'apex' not in version.tags
+ keep = no_llndk_no_apex or \
+ ('llndk' in version.tags and llndk) or \
('apex' in version.tags and apex)
if not keep:
return True
@@ -133,11 +133,11 @@
return False
-def should_omit_symbol(symbol, arch, api, vndk, apex):
+def should_omit_symbol(symbol, arch, api, llndk, apex):
"""Returns True if the symbol should be omitted."""
- no_vndk_no_apex = 'vndk' not in symbol.tags and 'apex' not in symbol.tags
- keep = no_vndk_no_apex or \
- ('vndk' in symbol.tags and vndk) or \
+ no_llndk_no_apex = 'llndk' not in symbol.tags and 'apex' not in symbol.tags
+ keep = no_llndk_no_apex or \
+ ('llndk' in symbol.tags and llndk) or \
('apex' in symbol.tags and apex)
if not keep:
return True
@@ -250,12 +250,12 @@
class SymbolFileParser(object):
"""Parses NDK symbol files."""
- def __init__(self, input_file, api_map, arch, api, vndk, apex):
+ def __init__(self, input_file, api_map, arch, api, llndk, apex):
self.input_file = input_file
self.api_map = api_map
self.arch = arch
self.api = api
- self.vndk = vndk
+ self.llndk = llndk
self.apex = apex
self.current_line = None
@@ -284,11 +284,11 @@
symbol_names = set()
multiply_defined_symbols = set()
for version in versions:
- if should_omit_version(version, self.arch, self.api, self.vndk, self.apex):
+ if should_omit_version(version, self.arch, self.api, self.llndk, self.apex):
continue
for symbol in version.symbols:
- if should_omit_symbol(symbol, self.arch, self.api, self.vndk, self.apex):
+ if should_omit_symbol(symbol, self.arch, self.api, self.llndk, self.apex):
continue
if symbol.name in symbol_names:
@@ -372,12 +372,12 @@
class Generator(object):
"""Output generator that writes stub source files and version scripts."""
- def __init__(self, src_file, version_script, arch, api, vndk, apex):
+ def __init__(self, src_file, version_script, arch, api, llndk, apex):
self.src_file = src_file
self.version_script = version_script
self.arch = arch
self.api = api
- self.vndk = vndk
+ self.llndk = llndk
self.apex = apex
def write(self, versions):
@@ -387,14 +387,14 @@
def write_version(self, version):
"""Writes a single version block's data to the output files."""
- if should_omit_version(version, self.arch, self.api, self.vndk, self.apex):
+ if should_omit_version(version, self.arch, self.api, self.llndk, self.apex):
return
section_versioned = symbol_versioned_in_api(version.tags, self.api)
version_empty = True
pruned_symbols = []
for symbol in version.symbols:
- if should_omit_symbol(symbol, self.arch, self.api, self.vndk, self.apex):
+ if should_omit_symbol(symbol, self.arch, self.api, self.llndk, self.apex):
continue
if symbol_versioned_in_api(symbol.tags, self.api):
@@ -456,7 +456,7 @@
'--arch', choices=ALL_ARCHITECTURES, required=True,
help='Architecture being targeted.')
parser.add_argument(
- '--vndk', action='store_true', help='Use the VNDK variant.')
+ '--llndk', action='store_true', help='Use the LLNDK variant.')
parser.add_argument(
'--apex', action='store_true', help='Use the APEX variant.')
@@ -493,14 +493,14 @@
with open(args.symbol_file) as symbol_file:
try:
versions = SymbolFileParser(symbol_file, api_map, args.arch, api,
- args.vndk, args.apex).parse()
+ args.llndk, args.apex).parse()
except MultiplyDefinedSymbolError as ex:
sys.exit('{}: error: {}'.format(args.symbol_file, ex))
with open(args.stub_src, 'w') as src_file:
with open(args.version_script, 'w') as version_file:
generator = Generator(src_file, version_file, args.arch, api,
- args.vndk, args.apex)
+ args.llndk, args.apex)
generator.write(versions)