INNER CODE UNIT · Python

get_ndk_home

syncthing/syncthing-android · syncthing/build-syncthing.py:59

def get_ndk_home():
    if not os.environ.get('ANDROID_NDK_HOME', ''):
        if not os.environ.get('NDK_VERSION', '') or not os.environ.get('ANDROID_HOME', ''):
            fail('ANDROID_NDK_HOME or NDK_VERSION and ANDROID_HOME environment variable must be defined')
        return os.path.join(os.environ['ANDROID_HOME'], 'ndk', os.environ['NDK_VERSION'])
    return os.environ['ANDROID_NDK_HOME']

if platform.system() not in PLATFORM_DIRS:
    fail('Unsupported python platform %s. Supported platforms: %s', platform.system(),
         ', '.join(PLATFORM_DIRS.keys()))

module_dir = os.path.dirname(os.path.realpath(__file__))
project_dir = os.path.realpath(os.path.join(module_dir, '..'))
# Use separate build dir so standalone ndk isn't deleted by `gradle clean`
build_dir = os.path.join(module_dir, 'gobuild')
go_build_dir = os.path.join(build_dir, 'go-packages')
syncthing_dir = os.path.join(module_dir, 'src', 'github.com', 'syncthing', 'syncthing')
min_sdk = get_min_sdk(project_dir)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…