Add a script to generate various build variants

This commit is contained in:
Pierre-Hugues Husson 2017-12-17 18:12:19 +01:00
parent 1cbdf550d8
commit cdf726b0fd
4 changed files with 45 additions and 17 deletions

View File

@ -1,2 +0,0 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/treble_arm64_ag.mk

View File

@ -11,3 +11,5 @@ BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy
DEVICE_PACKAGE_OVERLAYS += device/phh/treble/overlay
$(call inherit-product, vendor/hardware_overlay/overlay.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)

43
generate.sh Normal file
View File

@ -0,0 +1,43 @@
#!/bin/bash
echo 'PRODUCT_MAKEFILES := \' > AndroidProducts.mk
for part in a ab;do
for apps in vanilla gapps foss;do
for arch in arm64;do
apps_suffix=""
apps_script=""
apps_name=""
if [ "$apps" == "gapps" ];then
apps_suffix="g"
apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
apps_name="with GApps"
fi
if [ "$apps" == "foss" ];then
apps_suffix="f"
apps_script='$(call inherit-product, vendor/foss/foss.mk)'
apps_name="with FOSS apps"
fi
if [ "$apps" == "vanilla" ];then
apps_suffix="v"
apps_script=''
apps_name="vanilla"
fi
target="treble_${arch}_${part}${apps_suffix}"
cat > ${target}.mk << EOF
include build/make/target/product/treble_common.mk
\$(call inherit-product, device/phh/treble/base.mk)
$apps_script
PRODUCT_NAME := $target
PRODUCT_DEVICE := generic_arm64_$part
PRODUCT_BRAND := Android
PRODUCT_MODEL := Phh-Treble $apps_name
EOF
echo -e '\t$(LOCAL_DIR)/'$target.mk '\' >> AndroidProducts.mk
done
done
done
echo >> AndroidProducts.mk

View File

@ -1,15 +0,0 @@
include build/make/target/product/treble_common.mk
#Need to be called first to be able to override later rules,
#but after treble_common which would override PRODUCT_PACKAGES
$(call inherit-product, device/phh/treble/base.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
$(call inherit-product, vendor/hardware_overlay/overlay.mk)
$(call inherit-product, device/phh/treble/gapps.mk)
PRODUCT_NAME := treble_arm64_ag
PRODUCT_DEVICE := generic_arm64_a
PRODUCT_BRAND := Android
PRODUCT_MODEL := Phh-Treble