aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross2017-03-21 19:41:03 -0500
committerColin Cross2017-03-23 11:44:08 -0500
commit8873713f36c4b0a737947b31ea8e28300e6df759 (patch)
tree51ecb5243c3a413834c9da08d7604ed7e61abd96 /envsetup.sh
parent2c280271ac43f546023545f8921a418d370bbf1e (diff)
downloadplatform-build-8873713f36c4b0a737947b31ea8e28300e6df759.tar.gz
platform-build-8873713f36c4b0a737947b31ea8e28300e6df759.tar.xz
platform-build-8873713f36c4b0a737947b31ea8e28300e6df759.zip
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
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh48
1 files changed, 20 insertions, 28 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 9680780f3..22808f48d 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -296,7 +296,7 @@ function set_stuff_for_environment()
296 296
297function set_sequence_number() 297function set_sequence_number()
298{ 298{
299 export BUILD_ENV_SEQUENCE_NUMBER=12 299 export BUILD_ENV_SEQUENCE_NUMBER=13
300} 300}
301 301
302function settitle() 302function settitle()
@@ -569,50 +569,42 @@ function lunch()
569 then 569 then
570 selection=${LUNCH_MENU_CHOICES[$(($answer-1))]} 570 selection=${LUNCH_MENU_CHOICES[$(($answer-1))]}
571 fi 571 fi
572 elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$") 572 else
573 then
574 selection=$answer 573 selection=$answer
575 fi 574 fi
576 575
577 if [ -z "$selection" ]
578 then
579 echo
580 echo "Invalid lunch combo: $answer"
581 return 1
582 fi
583
584 export TARGET_BUILD_APPS= 576 export TARGET_BUILD_APPS=
585 577
586 local variant=$(echo -n $selection | sed -e "s/^[^\-]*-//") 578 local product variant_and_version variant version
587 check_variant $variant 579
588 if [ $? -ne 0 ] 580 product=${selection%%-*} # Trim everything after first dash
581 variant_and_version=${selection#*-} # Trim everything up to first dash
582 if [ "$variant_and_version" != "$selection" ]; then
583 variant=${variant_and_version%%-*}
584 if [ "$variant" != "$variant_and_version" ]; then
585 version=${variant_and_version#*-}
586 fi
587 fi
588
589 if [ -z "$product" ]
589 then 590 then
590 echo 591 echo
591 echo "** Invalid variant: '$variant'" 592 echo "Invalid lunch combo: $selection"
592 echo "** Must be one of ${VARIANT_CHOICES[@]}" 593 return 1
593 variant=
594 fi 594 fi
595 595
596 local product=$(echo -n $selection | sed -e "s/-.*$//")
597 TARGET_PRODUCT=$product \ 596 TARGET_PRODUCT=$product \
598 TARGET_BUILD_VARIANT=$variant \ 597 TARGET_BUILD_VARIANT=$variant \
598 TARGET_PLATFORM_VERSION=$version \
599 build_build_var_cache 599 build_build_var_cache
600 if [ $? -ne 0 ] 600 if [ $? -ne 0 ]
601 then 601 then
602 echo
603 echo "** Don't have a product spec for: '$product'"
604 echo "** Do you have the right repo manifest?"
605 product=
606 fi
607
608 if [ -z "$product" -o -z "$variant" ]
609 then
610 echo
611 return 1 602 return 1
612 fi 603 fi
613 604
614 export TARGET_PRODUCT=$product 605 export TARGET_PRODUCT=$(get_build_var TARGET_PRODUCT)
615 export TARGET_BUILD_VARIANT=$variant 606 export TARGET_BUILD_VARIANT=$(get_build_var TARGET_BUILD_VARIANT)
607 export TARGET_PLATFORM_VERSION=$(get_build_var TARGET_PLATFORM_VERSION)
616 export TARGET_BUILD_TYPE=release 608 export TARGET_BUILD_TYPE=release
617 609
618 echo 610 echo