2016-06-15 15:02:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
|
2016-07-04 14:20:42 +02:00
|
|
|
echo $0
|
2016-06-15 15:02:37 +02:00
|
|
|
set -e
|
2018-11-28 20:46:44 +01:00
|
|
|
set -x
|
2016-06-15 15:02:37 +02:00
|
|
|
|
2016-06-17 11:29:00 +02:00
|
|
|
NDK_BASE=$1
|
2016-06-15 15:02:37 +02:00
|
|
|
|
2016-06-17 11:29:00 +02:00
|
|
|
test -e $NDK_BASE || mkdir -p $NDK_BASE
|
|
|
|
cd $NDK_BASE
|
2016-06-15 15:02:37 +02:00
|
|
|
|
buildserver: trim pre-installed NDK list down to the bare minimum
This keeps the Long Term Support release and the latest release installed.
r10e was kept in because it needs a special extraction method, since it is
a .bin file, not a .zip. r12b is kept in because it is the old default.
Here is a survey of the NDK versions used in the most recent Builds entry
in each app that uses the NDK:
{'r10e': 6,
'r12b': 93,
'r13b': 4,
'r14b': 5,
'r15c': 7,
'r16b': 14,
'r17b': 4,
'r17c': 7,
'r18b': 9,
'r19c': 17,
'r20': 1,
'r20b': 22,
'r21': 3,
'r21d': 56,
'r21e': 65,
'r22': 9,
'r22b': 15,
'r9b': 1}
#517
import glob
import os
import yaml
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
ndks = dict()
for f in glob.glob('metadata/*.yml'):
with open(f) as fp:
app = yaml.load(fp, Loader=SafeLoader)
if app.get('Disable'):
continue
build = app.get('Builds', [])[-1]
if build.get('disabled'):
continue
ndk = build.get('ndk')
if ndk and ndk[1] == '9':
print(f, build)
elif ndk and int(ndk[2:3]) < 18:
print(f, build)
if ndk:
print(f, ndk)
if ndk not in ndks:
ndks[ndk] = 0
ndks[ndk] += 1
import pprint
pprint.pprint(ndks)
2021-05-12 15:04:24 +02:00
|
|
|
for version in r21e r22b; do
|
2017-06-28 16:55:34 +02:00
|
|
|
if [ ! -e ${NDK_BASE}/${version} ]; then
|
|
|
|
unzip /vagrant/cache/android-ndk-${version}-linux-x86_64.zip > /dev/null
|
2021-05-25 22:39:03 +02:00
|
|
|
mv android-ndk-${version} \
|
|
|
|
`sed -En 's,^Pkg.Revision *= *(.+),\1,p' android-ndk-${version}/source.properties`
|
2017-06-28 16:55:34 +02:00
|
|
|
fi
|
|
|
|
done
|
2017-07-04 10:44:25 +02:00
|
|
|
|
2021-05-25 22:39:03 +02:00
|
|
|
# allow gradle/etc to install missing NDK versions
|
|
|
|
chgrp vagrant $NDK_BASE
|
|
|
|
chmod g+w $NDK_BASE
|
|
|
|
|
|
|
|
# ensure all users can read and execute the NDK
|
2016-06-17 11:29:00 +02:00
|
|
|
chmod -R a+rX $NDK_BASE/
|
|
|
|
find $NDK_BASE/ -type f -executable -print0 | xargs -0 chmod a+x
|