From eea486a58033a4d444363ec07ccf35645abaad0c Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Fri, 26 Feb 2021 11:38:21 +0000 Subject: Respect `provides_uses_lib` for modules added via `[optional_]uses_libs` Previously `provides_uses_lib` property affected only those dependencies that are automatically deduced by Soong as implicit Java SDK libraries reachable from the `libs` property. Other dependencies that are explicitly added in `uses_libs` and `optional_uses_libs` properties ignored `provides_uses_lib`. As TestUsesLibraries shows (see the TODOs), Soong behaviour is still incorrect in two ways (to be addressed in follow-up CLs): - `uses_libs`/`optional_uses_libs` are passed to manifest_fixer - verify_uses_libraries check is based on `uses_libs`/ `optional_uses_libs`, and not on the CLC as it should be Bug: 132357300 Test: m nothing Change-Id: I0ec7aab9dcd44554d1a79ddd382491c562266fa3 --- java/app_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'java/app_test.go') diff --git a/java/app_test.go b/java/app_test.go index 49364f04f..de06c294c 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -2312,10 +2312,9 @@ func TestUsesLibraries(t *testing.T) { `--uses-library qux ` + `--uses-library quuz ` + `--uses-library foo ` + // TODO(b/132357300): "foo" should not be passed to manifest_fixer - `--uses-library non-sdk-lib ` + // TODO(b/132357300): "non-sdk-lib" should not be passed to manifest_fixer + `--uses-library com.non.sdk.lib ` + // TODO(b/132357300): "com.non.sdk.lib" should not be passed to manifest_fixer `--uses-library bar ` + // TODO(b/132357300): "bar" should not be passed to manifest_fixer - `--uses-library runtime-library ` + - `--uses-library com.non.sdk.lib` // TODO(b/132357300): "com.non.sdk.lib" should not be passed to manifest_fixer + `--uses-library runtime-library` if actualManifestFixerArgs != expectManifestFixerArgs { t.Errorf("unexpected manifest_fixer args:\n\texpect: %q\n\tactual: %q", expectManifestFixerArgs, actualManifestFixerArgs) @@ -2324,11 +2323,10 @@ func TestUsesLibraries(t *testing.T) { // Test that all libraries are verified (library order matters). verifyCmd := app.Rule("verify_uses_libraries").RuleParams.Command verifyArgs := `--uses-library foo ` + - `--uses-library non-sdk-lib ` + // TODO(b/132357300): "non-sdk-lib" should not be here + `--uses-library com.non.sdk.lib ` + `--uses-library qux ` + `--uses-library quuz ` + `--uses-library runtime-library ` + - `--uses-library com.non.sdk.lib ` + `--optional-uses-library bar ` + `--optional-uses-library baz ` if !strings.Contains(verifyCmd, verifyArgs) { -- cgit v1.2.3-59-g8ed1b