parameters: (android_ndk_home_path)
return_statement: return ndk_api_level
docstring: Check the revision number of an Android NDK path.
docstring_summary: Check the revision number of an Android NDK path.
docstring_tokens: Check the revision number of an Android NDK path .
function: def check_ndk_level(android_ndk_home_path):
    """Check the revision number of an Android NDK path."""
    properties_path = '%s/source.properties' % android_ndk_home_path
    if is_windows() or is_cygwin():
      properties_path = cygpath(properties_path)
    with open(properties_path, 'r') as f:
      filedata = f.read()
  
    revision = re.search(r'Pkg.Revision = (\d+)', filedata)
    if revision:
      ndk_api_level = revision.group(1)
    else:
      raise Exception('Unable to parse NDK revision.')
    if int(ndk_api_level) not in _SUPPORTED_ANDROID_NDK_VERSIONS:
      print('WARNING: The API level of the NDK in %s is %s, which is not '
            'supported by Bazel (officially supported versions: %s). Please use '
            'another version. Compiling Android targets may result in confusing '
            'errors.\n' % (android_ndk_home_path, ndk_api_level,
                           _SUPPORTED_ANDROID_NDK_VERSIONS))
    return ndk_api_level
function_tokens: def check_ndk_level ( android_ndk_home_path ) : properties_path = '%s/source.properties' % android_ndk_home_path if is_windows ( ) or is_cygwin ( ) : properties_path = cygpath ( properties_path ) with open ( properties_path , 'r' ) as f : filedata = f . read ( ) revision = re . search ( r'Pkg.Revision = (\d+)' , filedata ) if revision : ndk_api_level = revision . group ( 1 ) else : raise Exception ( 'Unable to parse NDK revision.' ) if int ( ndk_api_level ) not in _SUPPORTED_ANDROID_NDK_VERSIONS : print ( 'WARNING: The API level of the NDK in %s is %s, which is not ' 'supported by Bazel (officially supported versions: %s). Please use ' 'another version. Compiling Android targets may result in confusing ' 'errors.\n' % ( android_ndk_home_path , ndk_api_level , _SUPPORTED_ANDROID_NDK_VERSIONS ) ) return ndk_api_level