Merge "Do not call build/envsetup.sh in create_reference_dumps"
This commit is contained in:
@@ -210,22 +210,24 @@ def run_abi_diff(old_test_dump_path, new_test_dump_path, arch, lib_name,
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def get_build_vars_for_product(names, product=None):
|
def get_build_vars_for_product(names, product=None, variant=None):
|
||||||
""" Get build system variable for the launched target."""
|
""" Get build system variable for the launched target."""
|
||||||
|
|
||||||
if product is None and 'ANDROID_PRODUCT_OUT' not in os.environ:
|
if product is None and 'ANDROID_PRODUCT_OUT' not in os.environ:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
cmd = ''
|
env = os.environ.copy()
|
||||||
if product is not None:
|
if product:
|
||||||
cmd += 'source build/envsetup.sh > /dev/null && '
|
env['TARGET_PRODUCT'] = product
|
||||||
cmd += 'lunch ' + product + ' > /dev/null && '
|
if variant:
|
||||||
cmd += 'build/soong/soong_ui.bash --dumpvars-mode -vars \"'
|
env['TARGET_BUILD_VARIANT'] = variant
|
||||||
cmd += ' '.join(names)
|
cmd = [
|
||||||
cmd += '\"'
|
os.path.join('build', 'soong', 'soong_ui.bash'),
|
||||||
|
'--dumpvars-mode', '-vars', ' '.join(names),
|
||||||
|
]
|
||||||
|
|
||||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE, cwd=AOSP_DIR, shell=True)
|
stderr=subprocess.PIPE, cwd=AOSP_DIR, env=env)
|
||||||
out, err = proc.communicate()
|
out, err = proc.communicate()
|
||||||
|
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user