Files
android_packages_modules_co…/tools/gen_sdkinfo.py
satayev 075d07c591 Move SdkExtensions/proto to packages/modules/common.
The proto definitions may be needed at build time to generate appropriate
configs for the modules. Unbundled ART branches do not include
packages/modules/SdkExtenstion in their manifest; so put the proto in a
project that should be visible to all unbundled modules.

Move any relevant tools to packages/modules/common/tools as well.

Bug: 180105615
Test: m nothing
Change-Id: I4efa4300553af6b321f46adb29b8cc90e4556955
2021-05-10 18:27:54 +01:00

20 lines
508 B
Python

import sdk_pb2
import sys
if __name__ == '__main__':
argv = sys.argv[1:]
if not len(argv) == 4 or sorted([argv[0], argv[2]]) != ['-o', '-v']:
print('usage: gen_sdkinfo -v <version> -o <output-file>')
sys.exit(1)
for i in range(len(argv)):
if sys.argv[i] == '-o':
filename = sys.argv[i+1]
if sys.argv[i] == '-v':
version = int(sys.argv[i+1])
proto = sdk_pb2.SdkVersion()
proto.version = version
with open(filename, 'wb') as f:
f.write(proto.SerializeToString())