cmd/gomobile: bump minimum sdk version and update gradle for NDK 18

NDK 18 drops support for API levels below 16. Bump it to 16.

NDK 18 also needs a newer version of the Android gradle plugin.
Update the bind example and test build.gradle files.

Change-Id: I71499c88b48c43b2d4da50e415cb0b0dcbbbed75
Reviewed-on: https://go-review.googlesource.com/136775
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
Elias Naur 2018-09-22 10:05:19 +02:00
Родитель f9c332960c
Коммит 920b52be60
4 изменённых файлов: 13 добавлений и 10 удалений

Просмотреть файл

@ -195,27 +195,30 @@ const buildgradle = `buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
allprojects {
repositories { jcenter() }
repositories {
google()
jcenter()
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 'android-19'
buildToolsVersion '21.1.2'
defaultConfig { minSdkVersion 15 }
defaultConfig { minSdkVersion 16 }
}
repositories {
flatDir { dirs 'libs' }
}
dependencies {
compile(name: "pkg", ext: "aar")
implementation(name: "pkg", ext: "aar")
}
`

Просмотреть файл

@ -272,7 +272,7 @@ var ndk = ndkConfig{
"arm": {
arch: "arm",
abi: "armeabi-v7a",
platform: "android-15",
platform: "android-16",
gcc: "arm-linux-androideabi-4.9",
toolPrefix: "arm-linux-androideabi",
},
@ -287,7 +287,7 @@ var ndk = ndkConfig{
"386": {
arch: "x86",
abi: "x86",
platform: "android-15",
platform: "android-16",
gcc: "x86-4.9",
toolPrefix: "i686-linux-android",
},

Просмотреть файл

@ -115,9 +115,9 @@ rm -r -f "$GOMOBILE"
mkdir -p $GOMOBILE
WORK={{.GOPATH}}/pkg/gomobile/work
go install -x golang.org/x/mobile/cmd/gobind
PWD=$NDK_PATH $NDK_PATH/prebuilt/{{.GOOS}}-{{.NDKARCH}}/bin/python2.7 build/tools/make_standalone_toolchain.py --arch=arm --api=15 --install-dir=$GOMOBILE/ndk-toolchains/arm
PWD=$NDK_PATH $NDK_PATH/prebuilt/{{.GOOS}}-{{.NDKARCH}}/bin/python2.7 build/tools/make_standalone_toolchain.py --arch=arm --api=16 --install-dir=$GOMOBILE/ndk-toolchains/arm
PWD=$NDK_PATH $NDK_PATH/prebuilt/{{.GOOS}}-{{.NDKARCH}}/bin/python2.7 build/tools/make_standalone_toolchain.py --arch=arm64 --api=21 --install-dir=$GOMOBILE/ndk-toolchains/arm64
PWD=$NDK_PATH $NDK_PATH/prebuilt/{{.GOOS}}-{{.NDKARCH}}/bin/python2.7 build/tools/make_standalone_toolchain.py --arch=x86 --api=15 --install-dir=$GOMOBILE/ndk-toolchains/x86
PWD=$NDK_PATH $NDK_PATH/prebuilt/{{.GOOS}}-{{.NDKARCH}}/bin/python2.7 build/tools/make_standalone_toolchain.py --arch=x86 --api=16 --install-dir=$GOMOBILE/ndk-toolchains/x86
PWD=$NDK_PATH $NDK_PATH/prebuilt/{{.GOOS}}-{{.NDKARCH}}/bin/python2.7 build/tools/make_standalone_toolchain.py --arch=x86_64 --api=21 --install-dir=$GOMOBILE/ndk-toolchains/x86_64
cp $OPENAL_PATH/include/AL/al.h $GOMOBILE/include/AL/al.h
mkdir -p $GOMOBILE/include/AL

Просмотреть файл

@ -9,7 +9,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.0'
}
}