Update NDK (#1695)

* Updated Syncthing to v1.18.3-rc.1

* Allow building on windows

* Update NDK

* Revert "Updated Syncthing to v1.18.3-rc.1"

This reverts commit 377482c855.
This commit is contained in:
Audrius Butkevicius 2021-09-17 23:47:53 +01:00 committed by GitHub
parent d413912716
commit 14ecc39b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 11 deletions

View File

@ -27,7 +27,7 @@ android {
// Changes to these values need to be reflected in `.travis.yml`
compileSdkVersion 29
buildToolsVersion '29.0.3'
ndkVersion = '21.4.7075529'
ndkVersion = '23.0.7599858'
buildTypes.debug.applicationIdSuffix ".debug"
dataBinding.enabled = true

View File

@ -1,8 +1,8 @@
FROM openjdk:11
ENV GO_VERSION 1.17
ENV GO_VERSION 1.17.1
ARG ANDROID_SDK_VERSION=7302050
ARG ANDROID_SDK_VERSION=7583922
ARG ANDROID_SDK_FILENAME=commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip
WORKDIR /opt
@ -27,7 +27,7 @@ ARG SDKMANAGER="${ANDROID_HOME}/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROI
RUN yes | $SDKMANAGER --licenses > /dev/null
# NDK version (r22 fails to build)
ENV NDK_VERSION 21.4.7075529
ENV NDK_VERSION 23.0.7599858
# Install other android packages, including NDK
RUN $SDKMANAGER tools platform-tools "build-tools;29.0.3" "platforms;android-29" "extras;android;m2repository" "ndk;${NDK_VERSION}"

View File

@ -1,11 +1,16 @@
from __future__ import print_function
import os
import os.path
import sys
import subprocess
import platform
import subprocess
import sys
SUPPORTED_PYTHON_PLATFORMS = ['Windows', 'Linux', 'Darwin']
PLATFORM_DIRS = {
'Windows': 'windows-x86_64',
'Linux': 'linux-x86_64',
'Darwin': 'darwin-x86-64',
}
# The values here must correspond with those in ../docker/prebuild.sh
BUILD_TARGETS = [
@ -37,6 +42,7 @@ BUILD_TARGETS = [
}
]
def fail(message, *args, **kwargs):
print((message % args).format(**kwargs))
sys.exit(1)
@ -58,13 +64,13 @@ def get_ndk_home():
return os.environ['ANDROID_NDK_HOME']
if platform.system() not in SUPPORTED_PYTHON_PLATFORMS:
if platform.system() not in PLATFORM_DIRS:
fail('Unsupported python platform %s. Supported platforms: %s', platform.system(),
', '.join(SUPPORTED_PYTHON_PLATFORMS))
', '.join(PLATFORM_DIRS.keys()))
module_dir = os.path.dirname(os.path.realpath(__file__))
project_dir = os.path.realpath(os.path.join(module_dir, '..'))
# Use seperate build dir so standalone ndk isn't deleted by `gradle clean`
# 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')
@ -92,7 +98,7 @@ for target in BUILD_TARGETS:
})
cc = '/'.join([
get_ndk_home(), "toolchains/llvm/prebuilt/linux-x86_64", "bin",
get_ndk_home(), "toolchains/llvm/prebuilt/", PLATFORM_DIRS[platform.system()], "bin",
target['cc']])
subprocess.check_call(
['go', 'run', 'build.go', '-goos', 'android',