chiark / gitweb /
common: don't insert $ANDROID_NDK to local.props
[fdroidserver.git] / fdroidserver / common.py
index ce81b3855ba2f901690afc07d5a6284d4e3d189e..9f7e6c1ba37572626cd1cda8796fd23c23955037 100644 (file)
@@ -56,7 +56,8 @@ default_config = {
     'sdk_path': "$ANDROID_HOME",
     'ndk_paths': {
         'r9b': None,
-        'r10e': "$ANDROID_NDK",
+        'r10e': None,
+        'r12b': "$ANDROID_NDK",
     },
     'build_tools': "24.0.0",
     'force_build_tools': False,
@@ -1372,7 +1373,12 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
             props += "sdk.dir=%s\n" % config['sdk_path']
             props += "sdk-location=%s\n" % config['sdk_path']
         ndk_path = build.ndk_path()
-        if ndk_path:
+        # if it wasn't expanded correctly (because the NDK is not
+        # installed or $ANDROID_NDK not set properly), don't insert it.
+        # even if not actually used, Gradle will error with a cryptic
+        # message.
+        # https://gitlab.com/fdroid/fdroidserver/issues/171
+        if ndk_path and ndk_path[0] != '$':
             # Add ndk location
             props += "ndk.dir=%s\n" % ndk_path
             props += "ndk-location=%s\n" % ndk_path