Artur Satayev | 4535550 | 2020-05-14 15:15:01 +0100 | [diff] [blame^] | 1 | #!/bin/bash -e |
| 2 | # |
| 3 | # The script to run locally to re-generate global allowed list of dependencies |
| 4 | # for updatable modules. |
| 5 | |
| 6 | if [ ! -e "build/envsetup.sh" ]; then |
| 7 | echo "ERROR: $0 must be run from the top of the tree" |
| 8 | exit 1 |
| 9 | fi |
| 10 | |
| 11 | source build/envsetup.sh > /dev/null || exit 1 |
| 12 | |
| 13 | readonly OUT_DIR=$(get_build_var OUT_DIR) |
| 14 | |
| 15 | readonly ALLOWED_DEPS_FILE="build/soong/apex/allowed_deps.txt" |
| 16 | readonly 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. |
| 20 | m "${NEW_ALLOWED_DEPS_FILE}" -j |
| 21 | |
| 22 | cat > "${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. |
| 37 | EndOfFileComment |
| 38 | |
| 39 | cat "${NEW_ALLOWED_DEPS_FILE}" >> "${ALLOWED_DEPS_FILE}" |