1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-22 20:31:16 +00:00

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` // Changes to these values need to be reflected in `.travis.yml`
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.3' buildToolsVersion '29.0.3'
ndkVersion = '21.4.7075529' ndkVersion = '23.0.7599858'
buildTypes.debug.applicationIdSuffix ".debug" buildTypes.debug.applicationIdSuffix ".debug"
dataBinding.enabled = true dataBinding.enabled = true

View file

@ -1,8 +1,8 @@
FROM openjdk:11 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 ARG ANDROID_SDK_FILENAME=commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip
WORKDIR /opt WORKDIR /opt
@ -27,7 +27,7 @@ ARG SDKMANAGER="${ANDROID_HOME}/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROI
RUN yes | $SDKMANAGER --licenses > /dev/null RUN yes | $SDKMANAGER --licenses > /dev/null
# NDK version (r22 fails to build) # NDK version (r22 fails to build)
ENV NDK_VERSION 21.4.7075529 ENV NDK_VERSION 23.0.7599858
# Install other android packages, including NDK # 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}" 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 from __future__ import print_function
import os import os
import os.path import os.path
import sys
import subprocess
import platform 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 # The values here must correspond with those in ../docker/prebuild.sh
BUILD_TARGETS = [ BUILD_TARGETS = [
@ -37,6 +42,7 @@ BUILD_TARGETS = [
} }
] ]
def fail(message, *args, **kwargs): def fail(message, *args, **kwargs):
print((message % args).format(**kwargs)) print((message % args).format(**kwargs))
sys.exit(1) sys.exit(1)
@ -58,13 +64,13 @@ def get_ndk_home():
return os.environ['ANDROID_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(), 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__)) module_dir = os.path.dirname(os.path.realpath(__file__))
project_dir = os.path.realpath(os.path.join(module_dir, '..')) 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') build_dir = os.path.join(module_dir, 'gobuild')
go_build_dir = os.path.join(build_dir, 'go-packages') go_build_dir = os.path.join(build_dir, 'go-packages')
syncthing_dir = os.path.join(module_dir, 'src', 'github.com', 'syncthing', 'syncthing') syncthing_dir = os.path.join(module_dir, 'src', 'github.com', 'syncthing', 'syncthing')
@ -92,7 +98,7 @@ for target in BUILD_TARGETS:
}) })
cc = '/'.join([ 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']]) target['cc']])
subprocess.check_call( subprocess.check_call(
['go', 'run', 'build.go', '-goos', 'android', ['go', 'run', 'build.go', '-goos', 'android',