INNER CODE UNIT · Python

fail

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

def fail(message, *args, **kwargs):
    print((message % args).format(**kwargs))
    sys.exit(1)


def get_min_sdk(project_dir):
    with open(os.path.join(project_dir, 'app', 'build.gradle.kts')) as file_handle:
        for line in file_handle:
            tokens = list(filter(None, line.split()))
            if len(tokens) == 3 and tokens[0] == 'minSdk':
                return int(tokens[2])

    fail('Failed to find minSdkVersion')


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', ''):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…