chiark / gitweb /
common: extra checks for NDK in local.props
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 28 Jul 2016 06:26:51 +0000 (08:26 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 28 Jul 2016 06:26:51 +0000 (08:26 +0200)
The previous commit fixed it in local setups, this fixes it in broken
buildservers too and makes it more reliable.

fdroidserver/common.py

index 9f7e6c1ba37572626cd1cda8796fd23c23955037..b0a27ac4634b8e1d824fe03f3e1b0e9743eb58a6 100644 (file)
@@ -1373,12 +1373,11 @@ 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 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.
+        # if for any reason the path isn't valid or the directory
+        # doesn't exist, some versions of Gradle will error with a
+        # cryptic message (even if the NDK is not even necessary).
         # https://gitlab.com/fdroid/fdroidserver/issues/171
-        if ndk_path and ndk_path[0] != '$':
+        if ndk_path and os.path.exists(ndk_path):
             # Add ndk location
             props += "ndk.dir=%s\n" % ndk_path
             props += "ndk-location=%s\n" % ndk_path