provision-android-ndk: do all configuration via args

This makes it so it is easy to reuse this script in other contexts, like
in Docker, GitLab CI, etc.
This commit is contained in:
Hans-Christoph Steiner 2021-06-01 13:53:29 +02:00
parent d6c8ecc3bc
commit 28a4f9481a
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
2 changed files with 5 additions and 2 deletions

View file

@ -84,7 +84,7 @@ Vagrant.configure("2") do |config|
args: [configfile['debian_mirror']]
config.vm.provision "shell", path: "provision-android-sdk"
config.vm.provision "shell", path: "provision-android-ndk",
args: ["/opt/android-sdk/ndk"]
args: ["/opt/android-sdk/ndk", "r21e", "r22b"]
config.vm.provision "shell", path: "provision-gradle"
end

View file

@ -1,16 +1,19 @@
#!/bin/bash
#
# $1 is the root dir to install the NDKs into
# $2 and after are the NDK releases to install
echo $0
set -e
set -x
NDK_BASE=$1
shift
test -e $NDK_BASE || mkdir -p $NDK_BASE
cd $NDK_BASE
for version in r21e r22b; do
for version in $@; do
if [ ! -e ${NDK_BASE}/${version} ]; then
unzip /vagrant/cache/android-ndk-${version}-linux-x86_64.zip > /dev/null
mv android-ndk-${version} \