Rework androidenv package generation

androidenv did not previously write license files, which caused certain
gradle-based Android tools to fail. Restructure androidenv's list of
Android packages into a single repo.json file to prevent duplication
and enable us to extract the EULA texts, which we then hash with
builtins.hashString to produce the license files that Android gradle
tools look for.

Remove includeDocs and lldbVersions, as these have been removed
from the Android package repositories.

Improve documentation and examples.
This commit is contained in:
numinit
2021-01-03 21:27:23 -07:00
committed by Morgan Jones
parent 80677f372f
commit 5b91d4ab65
25 changed files with 6158 additions and 5066 deletions
+2 -35
View File
@@ -1,36 +1,3 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl libxslt
#!/bin/sh
set -e
die() {
echo "$1" >&2
exit 1
}
fetch() {
local url="https://dl.google.com/android/repository/$1"
echo "$url -> $2"
curl -s "$url" -o "$2" || die "Failed to fetch $url"
}
pushd "$(dirname "$0")" &>/dev/null || exit 1
mkdir -p xml
# Convert base packages
fetch repository2-1.xml xml/repository2-1.xml
xsltproc convertpackages.xsl xml/repository2-1.xml > generated/packages.nix
# Convert system images
for img in android android-tv android-wear android-wear-cn google_apis google_apis_playstore
do
fetch sys-img/$img/sys-img2-1.xml xml/$img-sys-img2-1.xml
xsltproc --stringparam imageType $img convertsystemimages.xsl xml/$img-sys-img2-1.xml > generated/system-images-$img.nix
done
# Convert system addons
fetch addon2-1.xml xml/addon2-1.xml
xsltproc convertaddons.xsl xml/addon2-1.xml > generated/addons.nix
popd &>/dev/null
./fetchrepo.sh && ./mkrepo.sh