-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TARGET_PLATFORM_VERSION to lunch
lunch can now take combos in the form: $TARGET_PRODUCT $TARGET_PRODUCT-$TARGET_BUILD_VARIANT $TARGET_PRODUCT-$TARGET_BUILD_VARIANT-$TARGET_PLATFORM_VERSION If all 3 are not specified the unspecified ones will take the default values provided by the build system (eng, and currently OPR1). In addition, error handling for invalid products, variants and versions is moved to the build system. Bug: 34972208 Test: build/make/tests/envsetup_tests.sh Change-Id: Ib0aaa98633448ba9bd8df911704c9cb3a8ebbe85
- Loading branch information
1 parent
2c28027
commit 8873713
Showing
6 changed files
with
68 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash -e | ||
|
||
source $(dirname $0)/../envsetup.sh | ||
|
||
unset TARGET_PRODUCT TARGET_BUILD_VARIANT TARGET_PLATFORM_VERSION | ||
|
||
function check_lunch | ||
( | ||
echo lunch $1 | ||
set +e | ||
lunch $1 > /dev/null 2> /dev/null | ||
set -e | ||
[ "$TARGET_PRODUCT" = "$2" ] || ( echo "lunch $1: expected TARGET_PRODUCT='$2', got '$TARGET_PRODUCT'" && exit 1 ) | ||
[ "$TARGET_BUILD_VARIANT" = "$3" ] || ( echo "lunch $1: expected TARGET_BUILD_VARIANT='$3', got '$TARGET_BUILD_VARIANT'" && exit 1 ) | ||
[ "$TARGET_PLATFORM_VERSION" = "$4" ] || ( echo "lunch $1: expected TARGET_PLATFORM_VERSION='$4', got '$TARGET_PLATFORM_VERSION'" && exit 1 ) | ||
) | ||
|
||
default_version=$(get_build_var DEFAULT_PLATFORM_VERSION) | ||
valid_version=PPR1 | ||
|
||
# lunch tests | ||
check_lunch "aosp_arm64" "aosp_arm64" "eng" "$default_version" | ||
check_lunch "aosp_arm64-userdebug" "aosp_arm64" "userdebug" "$default_version" | ||
check_lunch "aosp_arm64-userdebug-$valid_version" "aosp_arm64" "userdebug" "$valid_version" | ||
check_lunch "abc" "" "" "" | ||
check_lunch "aosp_arm64-abc" "" "" "" | ||
check_lunch "aosp_arm64-userdebug-abc" "" "" "" | ||
check_lunch "aosp_arm64-abc-$valid_version" "" "" "" | ||
check_lunch "abc-userdebug-$valid_version" "" "" "" | ||
check_lunch "-" "" "" "" | ||
check_lunch "--" "" "" "" | ||
check_lunch "-userdebug" "" "" "" | ||
check_lunch "-userdebug-" "" "" "" | ||
check_lunch "-userdebug-$valid_version" "" "" "" | ||
check_lunch "aosp_arm64-userdebug-$valid_version-" "" "" "" | ||
check_lunch "aosp_arm64-userdebug-$valid_version-abc" "" "" "" |