From 5f364b63b89bebc75ceb3d04b9efc4fe8aae26cd Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Tue, 30 Jun 2020 12:39:01 +0100 Subject: Rewrite construct_context.sh in Python. This allows to reuse SDK version comparison routine from other Python scripts. With the addition of non-numeric versions comparison has become more complex, and the deleted shell script did it incorrectly: it used comparisons like `[[ "S" -lt 28 ]]` which results in "true" as strings are converted to zero in numeric context. This resulted in adding legacy libraries to class loader context of apps targeting recent SDK versions. The error was masked because currently there is only one non-AOSP app that uses the script (GoogleDialer), and it targets numeric SDK version. Test: lunch aosp_cf_x86_phone-userdebug && m Bug: 132357300 Change-Id: I26e752e29b5453fd3e29d5dbfbe4d9df9c0a55b7 --- java/app_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/app_test.go') diff --git a/java/app_test.go b/java/app_test.go index 120dc00a6..e0c5820ea 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -2587,13 +2587,13 @@ func TestUsesLibraries(t *testing.T) { // Test that only present libraries are preopted cmd = app.Rule("dexpreopt").RuleParams.Command - if w := `dex_preopt_target_libraries="/system/framework/foo.jar /system/framework/bar.jar"`; !strings.Contains(cmd, w) { + if w := `--target-classpath-for-sdk any /system/framework/foo.jar:/system/framework/bar.jar`; !strings.Contains(cmd, w) { t.Errorf("wanted %q in %q", w, cmd) } cmd = prebuilt.Rule("dexpreopt").RuleParams.Command - if w := `dex_preopt_target_libraries="/system/framework/foo.jar /system/framework/bar.jar"`; !strings.Contains(cmd, w) { + if w := `--target-classpath-for-sdk any /system/framework/foo.jar:/system/framework/bar.jar`; !strings.Contains(cmd, w) { t.Errorf("wanted %q in %q", w, cmd) } } -- cgit v1.2.3-59-g8ed1b