mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
Merge branch 'install-buildserver-with-fdroid-sdkmanager' into 'master'
buildserver: install default SDK packages using fdroid/sdkmanager Closes #927 See merge request fdroid/fdroidserver!1212
This commit is contained in:
commit
c1b665e3f9
@ -48,11 +48,7 @@ RUN printf "path-exclude=/usr/share/locale/*\npath-exclude=/usr/share/man/*\npat
|
||||
&& bash /opt/buildserver/setup-env-vars /opt/android-sdk \
|
||||
&& . /etc/profile.d/bsenv.sh \
|
||||
&& bash /opt/buildserver/provision-apt-get-install https://deb.debian.org/debian \
|
||||
&& tools=tools_r25.2.5-linux.zip \
|
||||
&& mkdir -p /vagrant/cache \
|
||||
&& curl https://dl.google.com/android/repository/$tools > /vagrant/cache/$tools \
|
||||
&& echo "577516819c8b5fae680f049d39014ff1ba4af870b687cab10595783e6f22d33e /vagrant/cache/$tools" | sha256sum -c \
|
||||
&& bash /opt/buildserver/provision-android-sdk \
|
||||
&& bash /opt/buildserver/provision-android-sdk "tools;25.2.5" \
|
||||
&& bash /opt/buildserver/provision-android-ndk /opt/android-sdk/ndk \
|
||||
&& bash /opt/buildserver/provision-gradle \
|
||||
&& bash /opt/buildserver/provision-buildserverid $GIT_REV_PARSE_HEAD \
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
|
||||
echo $0
|
||||
set -e
|
||||
@ -10,19 +9,6 @@ if [ -z $ANDROID_HOME ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# TODO remove the rm, this should work with an existing ANDROID_HOME
|
||||
if [ ! -x $ANDROID_HOME/tools/android ]; then
|
||||
rm -rf $ANDROID_HOME
|
||||
mkdir ${ANDROID_HOME}
|
||||
mkdir ${ANDROID_HOME}/temp
|
||||
mkdir ${ANDROID_HOME}/platforms
|
||||
mkdir ${ANDROID_HOME}/build-tools
|
||||
cd $ANDROID_HOME
|
||||
|
||||
tools=`ls -1 /vagrant/cache/tools_*.zip | sort -n | tail -1`
|
||||
unzip -qq $tools
|
||||
fi
|
||||
|
||||
# disable the repositories of proprietary stuff
|
||||
disabled="
|
||||
@version@=1
|
||||
@ -40,59 +26,96 @@ for line in $disabled; do
|
||||
echo $line >> ${HOME}/.android/sites-settings.cfg
|
||||
done
|
||||
|
||||
# Include old makebuildserver cache that is a Vagrant synced_folder
|
||||
# for sdkmanager to use.
|
||||
cachedir=$HOME/.cache/sdkmanager
|
||||
mkdir -p $cachedir
|
||||
pushd $cachedir
|
||||
for f in /vagrant/cache/*.zip; do
|
||||
test -e $f && ln -s $f
|
||||
done
|
||||
popd
|
||||
|
||||
cd /vagrant/cache
|
||||
# TODO do not preinstall 'tools' or 'platform-tools' at all, app builds don't need them
|
||||
packages="
|
||||
tools;25.2.5
|
||||
platform-tools
|
||||
build-tools;19.1.0
|
||||
build-tools;20.0.0
|
||||
build-tools;21.1.2
|
||||
build-tools;22.0.1
|
||||
build-tools;23.0.1
|
||||
build-tools;23.0.2
|
||||
build-tools;23.0.3
|
||||
build-tools;24.0.0
|
||||
build-tools;24.0.1
|
||||
build-tools;24.0.2
|
||||
build-tools;24.0.3
|
||||
build-tools;25.0.0
|
||||
build-tools;25.0.1
|
||||
build-tools;25.0.2
|
||||
build-tools;25.0.3
|
||||
build-tools;26.0.0
|
||||
build-tools;26.0.1
|
||||
build-tools;26.0.2
|
||||
build-tools;26.0.3
|
||||
build-tools;27.0.0
|
||||
build-tools;27.0.1
|
||||
build-tools;27.0.2
|
||||
build-tools;27.0.3
|
||||
build-tools;28.0.0
|
||||
build-tools;28.0.1
|
||||
build-tools;28.0.2
|
||||
build-tools;28.0.3
|
||||
build-tools;29.0.2
|
||||
build-tools;29.0.3
|
||||
build-tools;30.0.0
|
||||
build-tools;30.0.1
|
||||
build-tools;30.0.2
|
||||
build-tools;30.0.3
|
||||
build-tools;31.0.0
|
||||
build-tools;32.0.0
|
||||
build-tools;33.0.0
|
||||
platforms;android-10
|
||||
platforms;android-11
|
||||
platforms;android-12
|
||||
platforms;android-13
|
||||
platforms;android-14
|
||||
platforms;android-15
|
||||
platforms;android-16
|
||||
platforms;android-17
|
||||
platforms;android-18
|
||||
platforms;android-19
|
||||
platforms;android-20
|
||||
platforms;android-21
|
||||
platforms;android-22
|
||||
platforms;android-23
|
||||
platforms;android-24
|
||||
platforms;android-25
|
||||
platforms;android-26
|
||||
platforms;android-27
|
||||
platforms;android-28
|
||||
platforms;android-29
|
||||
platforms;android-30
|
||||
platforms;android-31
|
||||
platforms;android-32
|
||||
platforms;android-33
|
||||
"
|
||||
|
||||
# make links for `android update sdk` to use and delete
|
||||
blocklist="build-tools_r17-linux.zip
|
||||
build-tools_r18.0.1-linux.zip
|
||||
build-tools_r18.1-linux.zip
|
||||
build-tools_r18.1.1-linux.zip
|
||||
build-tools_r19-linux.zip
|
||||
build-tools_r19.0.1-linux.zip
|
||||
build-tools_r19.0.2-linux.zip
|
||||
build-tools_r19.0.3-linux.zip
|
||||
build-tools_r21-linux.zip
|
||||
build-tools_r21.0.1-linux.zip
|
||||
build-tools_r21.0.2-linux.zip
|
||||
build-tools_r21.1-linux.zip
|
||||
build-tools_r21.1.1-linux.zip
|
||||
build-tools_r22-linux.zip
|
||||
build-tools_r23-linux.zip
|
||||
android-1.5_r04-linux.zip
|
||||
android-1.6_r03-linux.zip
|
||||
android-2.0_r01-linux.zip
|
||||
android-2.0.1_r01-linux.zip"
|
||||
latestm2=`ls -1 android_m2repository*.zip | sort -n | tail -1`
|
||||
for f in $latestm2 android-[0-9]*.zip platform-[0-9]*.zip build-tools_r*-linux.zip; do
|
||||
rm -f ${ANDROID_HOME}/temp/$f
|
||||
if [[ $blocklist != *$f* ]]; then
|
||||
ln -s /vagrant/cache/$f ${ANDROID_HOME}/temp/
|
||||
if [ $# -gt 0 ]; then
|
||||
echo found args
|
||||
packages=$@
|
||||
fi
|
||||
done
|
||||
|
||||
# install all cached platforms
|
||||
cached=""
|
||||
for f in `ls -1 android-[0-9]*.zip platform-[0-9]*.zip`; do
|
||||
sdk=`unzip -c $f "*/build.prop" | sed -n 's,^ro.build.version.sdk=,,p'`
|
||||
cached=,android-${sdk}${cached}
|
||||
done
|
||||
|
||||
# install all cached build-tools
|
||||
for f in `ls -1 build-tools*.zip`; do
|
||||
ver=`unzip -c $f "*/source.properties" | sed -n 's,^Pkg.Revision=,,p'`
|
||||
if [[ $ver == 24.0.0 ]] && [[ $f =~ .*r24\.0\.1.* ]]; then
|
||||
# 24.0.1 has the wrong revision in the zip
|
||||
ver=24.0.1
|
||||
# temporary test of whether this script ran. It will change once
|
||||
# 'tools' is no longer installed by default.
|
||||
if [ ! -x $ANDROID_HOME/tools/bin/sdkmanager ]; then
|
||||
mkdir -p ${ANDROID_HOME}/
|
||||
sdkmanager $packages
|
||||
fi
|
||||
cached=,build-tools-${ver}${cached}
|
||||
done
|
||||
|
||||
${ANDROID_HOME}/tools/android update sdk --no-ui --all \
|
||||
--filter platform-tools,extra-android-m2repository${cached} <<EOH
|
||||
y
|
||||
|
||||
EOH
|
||||
# this hacked cache should not end up in the Vagrant box or Docker image
|
||||
rm -rf $cachedir
|
||||
|
||||
mkdir -p $ANDROID_HOME/licenses/
|
||||
|
||||
@ -129,6 +152,7 @@ chmod g+w $ANDROID_HOME
|
||||
find $ANDROID_HOME/ -type f -executable -print0 | xargs -0 chmod a+x
|
||||
|
||||
# allow gradle to install newer build-tools and platforms
|
||||
mkdir -p $ANDROID_HOME/{build-tools,platforms}
|
||||
chgrp vagrant $ANDROID_HOME/{build-tools,platforms}
|
||||
chmod g+w $ANDROID_HOME/{build-tools,platforms}
|
||||
|
||||
|
@ -61,6 +61,7 @@ packages="
|
||||
mercurial
|
||||
patch
|
||||
rsync
|
||||
sdkmanager
|
||||
sudo
|
||||
"
|
||||
|
||||
|
125
makebuildserver
125
makebuildserver
@ -134,131 +134,6 @@ if config['apt_package_cache']:
|
||||
shutil.rmtree(aptcachepartial)
|
||||
|
||||
CACHE_FILES = [
|
||||
# Don't update sdk tools beyond 25.2.5.
|
||||
# Support for android update project has been removed and there is no replacement.
|
||||
# Until we find a solution for that we need to stay at this revision.
|
||||
('https://dl.google.com/android/repository/tools_r25.2.5-linux.zip',
|
||||
'577516819c8b5fae680f049d39014ff1ba4af870b687cab10595783e6f22d33e'),
|
||||
('https://dl.google.com/android/repository/android_m2repository_r47.zip',
|
||||
'a3f91808dce50c1717737de90c18479ed3a78b147e06985247d138e7ab5123d0'),
|
||||
('https://dl.google.com/android/repository/android-2.1_r03.zip',
|
||||
'b9cc140a9b879586181b22cfc7d4aa18b979251e16e9b17771c5d0acb71ba940'),
|
||||
('https://dl.google.com/android/repository/android-2.2_r03.zip',
|
||||
'7c9ea1bd7cb225504bd085d7c93ae27d52bd88d29b621d28108f82fef68177c0'),
|
||||
('https://dl.google.com/android/repository/android-2.3.1_r02.zip',
|
||||
'b2ab4896d0a4857e4f688f69eb08b0e1a8074709d4445a92a83ece7ec7cd198c'),
|
||||
('https://dl.google.com/android/repository/android-2.3.3_r02.zip',
|
||||
'54bdb0f1ca06ba5747061ddeea20f431af72c448334fd4d3d7f84ea2ccd29fea'),
|
||||
('https://dl.google.com/android/repository/android-3.0_r02.zip',
|
||||
'1cacae7b6e1b5a5d73c06f5d29d2ea92d16674df8fd5507681290e77d1647a1c'),
|
||||
('https://dl.google.com/android/repository/android-3.1_r03.zip',
|
||||
'7570c86a86488a146aa2141a65a24d81800959c1907ff4f1d2c13bbafab230c5'),
|
||||
('https://dl.google.com/android/repository/android-3.2_r01.zip',
|
||||
'ff6b26ad34d7060a72ba504b0314cef8ba3138005561705adec5ad470a073d9b'),
|
||||
('https://dl.google.com/android/repository/android-14_r04.zip',
|
||||
'da1af15c77ba41d062eb6d0ef5921cc424ab6167587033b830609d65f04802b6'),
|
||||
('https://dl.google.com/android/repository/android-15_r05.zip',
|
||||
'5bc1f93aae86b4336ffc4cae9eb8ec41a9a8fd677582dd86a9629798f019bed9'),
|
||||
('https://dl.google.com/android/repository/android-16_r05.zip',
|
||||
'fd7f269a423d1f1d079eabf9f918ceab49108702a1c6bb2589d57c23393503d3'),
|
||||
('https://dl.google.com/android/repository/android-17_r03.zip',
|
||||
'b66e73fb2639f8c916fde4369aa29012a5c531e156dbb205fe3788fe998fbbe8'),
|
||||
('https://dl.google.com/android/repository/android-18_r03.zip',
|
||||
'166ae9cf299747a5faa8f04168f0ee47cd7466a975d8b44acaaa62a43e767568'),
|
||||
('https://dl.google.com/android/repository/android-19_r04.zip',
|
||||
'5efc3a3a682c1d49128daddb6716c433edf16e63349f32959b6207524ac04039'),
|
||||
('https://dl.google.com/android/repository/android-20_r02.zip',
|
||||
'ef08c453e16ab6e656cf5d9413ef61cb8c650607d33b24ee4ce08dafdfe965a7'),
|
||||
('https://dl.google.com/android/repository/android-21_r02.zip',
|
||||
'a76cd7ad3080ac6ce9f037cb935b399a1bad396c0605d4ff42f693695f1dcefe'),
|
||||
('https://dl.google.com/android/repository/android-22_r02.zip',
|
||||
'45eb581bbe53c9256f34c26b2cea919543c0079140897ac721cf88c0b9f6789e'),
|
||||
('https://dl.google.com/android/repository/platform-23_r03.zip',
|
||||
'4b4bcddead3319708275c54c76294707bfaa953d767e34f1a5b599f3edd0076c'),
|
||||
('https://dl.google.com/android/repository/platform-24_r02.zip',
|
||||
'f268f5945c6ece7ea95c1c252067280854d2a20da924e22ae4720287df8bdbc9'),
|
||||
('https://dl.google.com/android/repository/platform-25_r03.zip',
|
||||
'9b742d34590fe73fb7229e34835ecffb1846ca389d9f924f0b2a37de525dc6b8'),
|
||||
('https://dl.google.com/android/repository/platform-26_r02.zip',
|
||||
'2aafa7d19c5e9c4b643ee6ade3d85ef89dc2f79e8383efdb9baf7fddad74b52a'),
|
||||
('https://dl.google.com/android/repository/platform-27_r03.zip',
|
||||
'020c4c090bc82ce87ebaae5d1a922e21b39a1d03c78ffa43f0c3e42fc7d28169'),
|
||||
('https://dl.google.com/android/repository/platform-28_r06.zip',
|
||||
'8452dbbf9668a428abb243c4f02a943b7aa83af3cca627629a15c4c09f28e7bd'),
|
||||
('https://dl.google.com/android/repository/platform-29_r05.zip',
|
||||
'951da8bf175254da74626824f919bd28def64f8828f29dd3b124a535cf4049d8'),
|
||||
('https://dl.google.com/android/repository/platform-30_r03.zip',
|
||||
'f3f5b75744dbf6ee6ed3e8174a71e513bfee502d0bc3463ea97e517bff68d84e'),
|
||||
('https://dl.google.com/android/repository/platform-31_r01.zip',
|
||||
'1d69fe1d7f9788d82ff3a374faf4f6ccc9d1d372aa84a86b5bcfb517523b0b3f'),
|
||||
('https://dl.google.com/android/repository/build-tools_r19.1-linux.zip',
|
||||
'3833b409f78c002a83244e220be380ea6fa44d604e0d47de4b7e5daefe7cd3f4'),
|
||||
('https://dl.google.com/android/repository/build-tools_r20-linux.zip',
|
||||
'296e09d62095d80e6eaa06a64cfa4c6f9f317c2d67ad8da6514523ec66f5c871'),
|
||||
('https://dl.google.com/android/repository/build-tools_r21.1.2-linux.zip',
|
||||
'3f88efc2d5316fb73f547f35b472610eed5e6f3f56762750ddad1c7d1d81660d'),
|
||||
('https://dl.google.com/android/repository/build-tools_r22.0.1-linux.zip',
|
||||
'91e5524bf227aad1135ddd10905518ac49f74797d33d48920dcf8364b9fde214'),
|
||||
('https://dl.google.com/android/repository/build-tools_r23.0.1-linux.zip',
|
||||
'e56b3ef7b760ad06a7cee9b2d52ba7f43133dcecedfa5357f8845b3a80aeeecf'),
|
||||
('https://dl.google.com/android/repository/build-tools_r23.0.2-linux.zip',
|
||||
'82754f551a6e36eaf516fbdd00c95ff0ccd19f81d1e134125b6ac4916f7ed9b6'),
|
||||
('https://dl.google.com/android/repository/build-tools_r23.0.3-linux.zip',
|
||||
'd961663d4a9e128841751c0156548a347c882c081c83942e53788d8949bf34e1'),
|
||||
('https://dl.google.com/android/repository/build-tools_r24-linux.zip',
|
||||
'b4871f357224c5f660fd2bbee04d8c7d1c187eeddfd9702cc84503529e3b3724'),
|
||||
('https://dl.google.com/android/repository/build-tools_r24.0.1-linux.zip',
|
||||
'a38ac637db357a31e33e38248399cb0edcc15040dca041370da38b6daf50c84d'),
|
||||
('https://dl.google.com/android/repository/build-tools_r24.0.2-linux.zip',
|
||||
'924e29b8a189afbd119d44eae450fc0c9f197ed6f835df223931e45007987d95'),
|
||||
('https://dl.google.com/android/repository/build-tools_r24.0.3-linux.zip',
|
||||
'f2c02eb1d7e41ce314b5dac50440e7595380c4dd45b41ea1d7b0f86e49516927'),
|
||||
('https://dl.google.com/android/repository/build-tools_r25-linux.zip',
|
||||
'74eb6931fd7a56859bd8e35d8d73ca8fe7ba6bfd4b7ffe560fe58b7354f2e3aa'),
|
||||
('https://dl.google.com/android/repository/build-tools_r25.0.1-linux.zip',
|
||||
'671b4e00f5b986c7355507c7024b725a4b4cadf11ca61fa5b1334ec6ea57d94f'),
|
||||
('https://dl.google.com/android/repository/build-tools_r25.0.2-linux.zip',
|
||||
'1d7ac9b6def16fb0254ec23c135c02dd9f6908073352a20315a017e4b2a904b0'),
|
||||
('https://dl.google.com/android/repository/build-tools_r25.0.3-linux.zip',
|
||||
'152c1b187947edd10c65af8b279d40321ecc106106323e53df3608e578042d65'),
|
||||
('https://dl.google.com/android/repository/build-tools_r26-linux.zip',
|
||||
'7422682f92fb471d4aad4c053c9982a9a623377f9d5e4de7a73cd44ebf2f3c61'),
|
||||
('https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip',
|
||||
'c8617f25a7de2aeb9ddcacf1aeb413e053d5ed5ef4a3f31fe0ce21d4428ee0ea'),
|
||||
('https://dl.google.com/android/repository/build-tools_r26.0.2-linux.zip',
|
||||
'a752849fac85c4a7f9ea165ec8f367b0ebe8bbf6a1f33fc8605342be004231ce'),
|
||||
('https://dl.google.com/android/repository/build-tools_r26.0.3-linux.zip',
|
||||
'5c250c602b1657c4c70a6078925e9e01e5714526b707309bc1c708be6137a4db'),
|
||||
('https://dl.google.com/android/repository/build-tools_r27-linux.zip',
|
||||
'53d3322774a0bf229b372c0288108b4bfa27d74725fce8f0a3393e8df6b9ef22'),
|
||||
('https://dl.google.com/android/repository/build-tools_r27.0.1-linux.zip',
|
||||
'2e8e0946e93af50667ae02ef200e81c1ac2269b59f14955397245e9e441e8b1e'),
|
||||
('https://dl.google.com/android/repository/build-tools_r27.0.2-linux.zip',
|
||||
'e73674e065a93ffb05c30a15c8021c0d72ea7c3c206eb9020eb93e49e42ce851'),
|
||||
('https://dl.google.com/android/repository/build-tools_r27.0.3-linux.zip',
|
||||
'5e1f4fc5203f13de120c56f9cc103bb2e57d940959547506196ab10ddc9e6b97'),
|
||||
('https://dl.google.com/android/repository/build-tools_r28-linux.zip',
|
||||
'a7c6b73661836a6c50e32c06e7b8e8d6ef8c96f6812f269b9c90470dfb37753c'),
|
||||
('https://dl.google.com/android/repository/build-tools_r28.0.1-linux.zip',
|
||||
'4825b52a6258a9c2ab073720a5e91e2fa81b552b48024ee81887b863397416af'),
|
||||
('https://dl.google.com/android/repository/build-tools_r28.0.2-linux.zip',
|
||||
'12cebcafd8f30119c7ef53ffb3562a5b5b9f776c9399038587c18df44ea6452b'),
|
||||
('https://dl.google.com/android/repository/build-tools_r28.0.3-linux.zip',
|
||||
'7954956a40633c88f693d638cbc23f68e9e2499dc7a4b7dfdaf6a3e91387749a'),
|
||||
('https://dl.google.com/android/repository/build-tools_r29.0.2-linux.zip',
|
||||
'1e9393cbfd4a4b82e30e7f55ab38db4a5a3259db93d5821c63597bc74522fa08'),
|
||||
('https://dl.google.com/android/repository/build-tools_r29.0.3-linux.zip',
|
||||
'5652d8cd5eaaade0b853bfe0ae6cbfa0706a6f70a0ebb25ca24a6f484ec3d855'),
|
||||
('https://dl.google.com/android/repository/build-tools_r30-linux.zip',
|
||||
'ed3b7f9b2d15e90a12c2e739adb749d7d834e2f953e677380206bd14db135c6c'),
|
||||
('https://dl.google.com/android/repository/build-tools_r30.0.1-linux.zip',
|
||||
'560eace2cc6ca16011fbb97c92c39aa0441d54dbfc13837dfbdb4a6bdf9c9da8'),
|
||||
('https://dl.google.com/android/repository/build-tools_r30.0.2-linux.zip',
|
||||
'565af786dc0cc1941002174fb945122eabd080b222cd4c7c3d9a2ae0fabf5dc4'),
|
||||
('https://dl.google.com/android/repository/build-tools_r30.0.3-linux.zip',
|
||||
'24593500aa95d2f99fb4f10658aae7e65cb519be6cd33fa164f15f27f3c4a2d6'),
|
||||
('https://dl.google.com/android/repository/build-tools_r31-linux.zip',
|
||||
'f90c22f5562638a2e00762e1711eebd55e7f0a05232b65200d387307d057bfe8'),
|
||||
('https://services.gradle.org/distributions/gradle-6.8.3-bin.zip',
|
||||
'7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205'),
|
||||
('https://services.gradle.org/distributions/gradle-7.0.2-bin.zip',
|
||||
|
Loading…
Reference in New Issue
Block a user