summaryrefslogtreecommitdiff
path: root/test/etc/apex_bootclasspath_utils.py
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2022-10-24 11:00:31 +0000
committer David Srbecky <dsrbecky@google.com> 2022-10-24 14:29:13 +0000
commite4e701b55ef341156d36db9dfc23f63d59dbf928 (patch)
tree6af321cc7264dca2b20013c0705c20ac625f804c /test/etc/apex_bootclasspath_utils.py
parent5b263aefb705fb19b627b5cf2e0db35223b8ea01 (diff)
Revert^2 "Convert per-test run scripts to python."
This reverts commit 8d6a4e021e1dc4717939e05aee89c9b18e383d12. Reason for revert: Reland Test: test.py -r --all-target Test: diff emitted test commands before and after Change-Id: I8b99d9b3804615f2ebc50171a4368ad87d809300
Diffstat (limited to 'test/etc/apex_bootclasspath_utils.py')
-rwxr-xr-xtest/etc/apex_bootclasspath_utils.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/etc/apex_bootclasspath_utils.py b/test/etc/apex_bootclasspath_utils.py
index f969b149b2..d2415e5d3d 100755
--- a/test/etc/apex_bootclasspath_utils.py
+++ b/test/etc/apex_bootclasspath_utils.py
@@ -23,10 +23,9 @@ import os, sys
# Note: This must start with the CORE_IMG_JARS in Android.common_path.mk
# because that's what we use for compiling the boot.art image.
# It may contain additional modules from TEST_CORE_JARS.
-bpath_modules="core-oj core-libart okhttp bouncycastle apache-xml core-icu4j conscrypt"
+bpath_modules = ("core-oj core-libart okhttp bouncycastle apache-xml core-icu4j"
+ " conscrypt")
-ANDROID_BUILD_TOP=os.environ["ANDROID_BUILD_TOP"]
-ANDROID_HOST_OUT=os.environ["ANDROID_HOST_OUT"]
# Helper function to construct paths for apex modules (for both -Xbootclasspath and
# -Xbootclasspath-location).
@@ -34,40 +33,44 @@ ANDROID_HOST_OUT=os.environ["ANDROID_HOST_OUT"]
# Arguments.
# ${1}: path prefix.
def get_apex_bootclasspath_impl(bpath_prefix: str):
- bpath_separator=""
- bpath=""
- bpath_jar=""
+ bpath_separator = ""
+ bpath = ""
+ bpath_jar = ""
for bpath_module in bpath_modules.split(" "):
- apex_module="com.android.art"
+ apex_module = "com.android.art"
if bpath_module == "conscrypt":
- apex_module="com.android.conscrypt"
+ apex_module = "com.android.conscrypt"
if bpath_module == "core-icu4j":
- apex_module="com.android.i18n"
- bpath_jar=f"/apex/{apex_module}/javalib/{bpath_module}.jar"
- bpath+=f"{bpath_separator}{bpath_prefix}{bpath_jar}"
- bpath_separator=":"
+ apex_module = "com.android.i18n"
+ bpath_jar = f"/apex/{apex_module}/javalib/{bpath_module}.jar"
+ bpath += f"{bpath_separator}{bpath_prefix}{bpath_jar}"
+ bpath_separator = ":"
return bpath
+
# Gets a -Xbootclasspath paths with the apex modules.
#
# Arguments.
# ${1}: host (y|n).
def get_apex_bootclasspath(host: bool):
- bpath_prefix=""
+ bpath_prefix = ""
if host:
- bpath_prefix=ANDROID_HOST_OUT
+ bpath_prefix = os.environ["ANDROID_HOST_OUT"]
return get_apex_bootclasspath_impl(bpath_prefix)
+
# Gets a -Xbootclasspath-location paths with the apex modules.
#
# Arguments.
# ${1}: host (y|n).
def get_apex_bootclasspath_locations(host: bool):
- bpath_location_prefix=""
+ bpath_location_prefix = ""
if host:
+ ANDROID_BUILD_TOP=os.environ["ANDROID_BUILD_TOP"]
+ ANDROID_HOST_OUT=os.environ["ANDROID_HOST_OUT"]
if ANDROID_HOST_OUT[0:len(ANDROID_BUILD_TOP)+1] == f"{ANDROID_BUILD_TOP}/":
bpath_location_prefix=ANDROID_HOST_OUT[len(ANDROID_BUILD_TOP)+1:]
else: