MCPcopy Index your code
hub / github.com/kivy/python-for-android / read_ndk_version

Function read_ndk_version

pythonforandroid/recommendations.py:112–131  ·  view source on GitHub ↗

Read the NDK version from the NDK dir, if possible

(ndk_dir)

Source from the content-addressed store, hash-verified

110
111
112def read_ndk_version(ndk_dir):
113 """Read the NDK version from the NDK dir, if possible"""
114 try:
115 with open(join(ndk_dir, 'source.properties')) as fileh:
116 ndk_data = fileh.read()
117 except IOError:
118 info(UNKNOWN_NDK_MESSAGE)
119 return
120
121 for line in ndk_data.split('\n'):
122 if line.startswith('Pkg.Revision'):
123 break
124 else:
125 info(PARSE_ERROR_NDK_MESSAGE)
126 return
127
128 # Line should have the form "Pkg.Revision = ..."
129 unparsed_ndk_version = line.split('=')[-1].strip()
130
131 return packaging.version.parse(unparsed_ndk_version)
132
133
134MIN_TARGET_API = 30

Callers 4

ndk_versionMethod · 0.90
test_read_ndk_versionMethod · 0.90
check_ndk_versionFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_read_ndk_versionMethod · 0.72