• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -e
2#
3# Copyright (C) 2021 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18#
19# The script to run locally to re-generate global allowed list of dependencies
20# for updatable modules.
21
22if [ ! -e "build/envsetup.sh" ]; then
23  echo "ERROR: $0 must be run from the top of the tree"
24  exit 1
25fi
26
27source build/envsetup.sh > /dev/null || exit 1
28
29readonly OUT_DIR=$(get_build_var OUT_DIR)
30
31readonly ALLOWED_DEPS_FILE="packages/modules/common/build/allowed_deps.txt"
32readonly NEW_ALLOWED_DEPS_FILE="${OUT_DIR}/soong/apex/depsinfo/new-allowed-deps.txt"
33
34# If the script is run after droidcore failure, ${NEW_ALLOWED_DEPS_FILE}
35# should already be built. If running the script manually, make sure it exists.
36m "${NEW_ALLOWED_DEPS_FILE}" -j
37
38cat > "${ALLOWED_DEPS_FILE}" << EndOfFileComment
39# A list of allowed dependencies for all updatable modules.
40#
41# The list tracks all direct and transitive dependencies that end up within any
42# of the updatable binaries; specifically excluding external dependencies
43# required to compile those binaries. This prevents potential regressions in
44# case a new dependency is not aware of the different functional and
45# non-functional requirements being part of an updatable module, for example
46# setting correct min_sdk_version.
47#
48# To update the list, run:
49# repo-root$ packages/modules/common/build/update-apex-allowed-deps.sh
50#
51# See go/apex-allowed-deps-error for more details.
52# TODO(b/157465465): introduce automated quality signals and remove this list.
53EndOfFileComment
54
55cat "${NEW_ALLOWED_DEPS_FILE}" >> "${ALLOWED_DEPS_FILE}"
56