blob: 872d746701d3b4b6f59eb05d5069a3bd3a25d938 [file] [log] [blame]
Artur Satayev45355502020-05-14 15:15:01 +01001#!/bin/bash -e
2#
3# The script to run locally to re-generate global allowed list of dependencies
4# for updatable modules.
5
6if [ ! -e "build/envsetup.sh" ]; then
7 echo "ERROR: $0 must be run from the top of the tree"
8 exit 1
9fi
10
11source build/envsetup.sh > /dev/null || exit 1
12
13readonly OUT_DIR=$(get_build_var OUT_DIR)
14
15readonly ALLOWED_DEPS_FILE="build/soong/apex/allowed_deps.txt"
16readonly NEW_ALLOWED_DEPS_FILE="${OUT_DIR}/soong/apex/depsinfo/new-allowed-deps.txt"
17
18# If the script is run after droidcore failure, ${NEW_ALLOWED_DEPS_FILE}
19# should already be built. If running the script manually, make sure it exists.
20m "${NEW_ALLOWED_DEPS_FILE}" -j
21
22cat > "${ALLOWED_DEPS_FILE}" << EndOfFileComment
23# A list of allowed dependencies for all updatable modules.
24#
25# The list tracks all direct and transitive dependencies that end up within any
26# of the updatable binaries; specifically excluding external dependencies
27# required to compile those binaries. This prevents potential regressions in
28# case a new dependency is not aware of the different functional and
29# non-functional requirements being part of an updatable module, for example
30# setting correct min_sdk_version.
31#
32# To update the list, run:
33# repo-root$ build/soong/scripts/update-apex-allowed-deps.sh
34#
35# See go/apex-allowed-deps-error for more details.
36# TODO(b/157465465): introduce automated quality signals and remove this list.
37EndOfFileComment
38
39cat "${NEW_ALLOWED_DEPS_FILE}" >> "${ALLOWED_DEPS_FILE}"