Jae Shin | 91a2c72 | 2017-11-22 14:06:27 +0900 | [diff] [blame] | 1 | #!/bin/bash -e |
Jae Shin | e242d62 | 2017-11-20 14:47:19 +0900 | [diff] [blame] | 2 | # |
| 3 | # Copyright (C) 2017 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 | |
Inseob Kim | e872405 | 2020-06-15 21:55:28 +0900 | [diff] [blame] | 18 | function die { |
| 19 | echo "$0: $*" |
| 20 | exit 1 |
| 21 | } |
| 22 | |
| 23 | function usage { |
| 24 | cat <<EOF |
| 25 | Usage: $0 [OPTION] |
| 26 | Build VNDK snapshots for all arches (arm64, arm, x86_64, x86). |
| 27 | |
| 28 | -a, --build-artifacts include exported header files and flags |
| 29 | -h, --help display this help and exit |
| 30 | |
| 31 | EOF |
| 32 | exit |
| 33 | } |
| 34 | |
| 35 | additional_option= |
| 36 | arches="arm64 arm x86_64 x86" |
| 37 | |
| 38 | while [[ $# -gt 0 ]]; do |
| 39 | case "$1" in |
| 40 | (-a|--build-artifacts) additional_option="VNDK_SNAPSHOT_BUILD_ARTIFACTS=true";; |
| 41 | (-h|--help) usage;; |
| 42 | (*) die "Unknown option: '$1' |
| 43 | Try '$0 --help' for more information.";; |
| 44 | esac |
| 45 | shift |
| 46 | done |
| 47 | |
Jae Shin | 91a2c72 | 2017-11-22 14:06:27 +0900 | [diff] [blame] | 48 | export TARGET_BUILD_VARIANT=user |
| 49 | export BOARD_VNDK_VERSION=current |
Jae Shin | e242d62 | 2017-11-20 14:47:19 +0900 | [diff] [blame] | 50 | |
Inseob Kim | e872405 | 2020-06-15 21:55:28 +0900 | [diff] [blame] | 51 | for arch in $arches; do |
| 52 | echo "-----Generating VNDK snapshot for $arch" |
| 53 | build/soong/soong_ui.bash --make-mode vndk dist TARGET_PRODUCT=aosp_$arch $additional_option |
| 54 | done |