Merge "Make build_vendor script configurable" am: b09c616b48 am: 0242c83aed am: a6ca8d6611 am: 88056ed243
Original change: https://android-review.googlesource.com/c/platform/development/+/2190438 Change-Id: Id7eca74525c3aefb4a021bdbfc1f6a0018185aef Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -15,18 +15,48 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
function usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 -d device-name -p product-name -r dist-dir
|
||||
Builds a vendor image for given product and analyze ninja inputs.
|
||||
|
||||
-d device name to build (e.g. vsoc_x86_64)
|
||||
-p product name to build (e.g. cf_x86_64_phone)
|
||||
-r directory for dist (e.g. out/dist)
|
||||
-h display this help and exit
|
||||
|
||||
EOF
|
||||
exit
|
||||
}
|
||||
|
||||
while getopts d:p:r:h flag
|
||||
do
|
||||
case "${flag}" in
|
||||
d) device=${OPTARG};;
|
||||
p) product=${OPTARG};;
|
||||
r) dist_dir=${OPTARG};;
|
||||
h) usage;;
|
||||
*) usage;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "$device" || -z "$product" || -z "$dist_dir" ]]; then
|
||||
echo "missing arguments"
|
||||
usage
|
||||
fi
|
||||
|
||||
export ALLOW_MISSING_DEPENDENCIES=true
|
||||
|
||||
build/soong/soong_ui.bash --make-mode vendorimage collect_ninja_inputs \
|
||||
TARGET_PRODUCT=cf_x86_64_phone TARGET_BUILD_VARIANT=userdebug
|
||||
TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=userdebug
|
||||
|
||||
mkdir -p $DIST_DIR/soong
|
||||
mkdir -p $dist_dir/soong
|
||||
|
||||
for f in out/*.ninja out/soong/build.ninja; do
|
||||
gzip -c $f > $DIST_DIR/${f#out/}.gz
|
||||
gzip -c $f > $dist_dir/${f#out/}.gz
|
||||
done
|
||||
|
||||
cp out/target/product/vsoc_x86_64/vendor.img $DIST_DIR
|
||||
cp out/target/product/$device/vendor.img $dist_dir
|
||||
|
||||
out/host/linux-x86/bin/collect_ninja_inputs -n prebuilts/build-tools/linux-x86/bin/ninja \
|
||||
-f out/combined-cf_x86_64_phone.ninja -t vendorimage > $DIST_DIR/ninja_inputs.json
|
||||
-f out/combined-$product.ninja -t vendorimage > $dist_dir/ninja_inputs.json
|
||||
|
||||
Reference in New Issue
Block a user