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:
Regular → Executable
+16
-20
@@ -1,27 +1,23 @@
|
||||
#!/bin/sh -e
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p jq
|
||||
|
||||
if [ "$1" = "" ]
|
||||
then
|
||||
echo "Please select a package set: 'packages', 'addons', 'system-images'" >&2
|
||||
set -e
|
||||
|
||||
pushd "$(dirname "$0")" &>/dev/null || exit 1
|
||||
|
||||
if [ "$1" == '' ]; then
|
||||
echo "Please select a group: 'packages', 'images', 'addons', 'extras', or 'licenses'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$2" = "" ]
|
||||
then
|
||||
echo "Please select a package group:" >&2
|
||||
( cat <<EOF
|
||||
builtins.attrNames (import ./generated/$1.nix {
|
||||
fetchurl = null;
|
||||
})
|
||||
EOF
|
||||
) | nix-instantiate --eval-only -
|
||||
namespace="$1"
|
||||
|
||||
exit 1
|
||||
if [ "$namespace" == 'licenses' ]; then
|
||||
jq -r '.licenses | keys | join("\n")' < repo.json
|
||||
else
|
||||
jq -r --arg NAMESPACE "$namespace" \
|
||||
'.[$NAMESPACE] | paths as $path | getpath($path) as $v | select($path[-1] == "displayName") | [[$NAMESPACE] + $path[:-1] | map("\"" + . + "\"") | join("."), $v] | join(": ")' \
|
||||
< repo.json
|
||||
fi
|
||||
|
||||
( cat <<EOF
|
||||
builtins.attrNames (import ./generated/$1.nix {
|
||||
fetchurl = null;
|
||||
}).$2
|
||||
EOF
|
||||
) | nix-instantiate --eval-only -
|
||||
popd &>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user