diff --git a/apex/apex_test.go b/apex/apex_test.go index cbe59531d..5d08f37ab 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -19,6 +19,7 @@ import ( "os" "path" "reflect" + "regexp" "sort" "strings" "testing" @@ -4256,6 +4257,15 @@ func TestLegacyAndroid10Support(t *testing.T) { } } +var filesForSdkLibrary = map[string][]byte{ + "api/current.txt": nil, + "api/removed.txt": nil, + "api/system-current.txt": nil, + "api/system-removed.txt": nil, + "api/test-current.txt": nil, + "api/test-removed.txt": nil, +} + func TestJavaSDKLibrary(t *testing.T) { ctx, _ := testApex(t, ` apex { @@ -4276,14 +4286,7 @@ func TestJavaSDKLibrary(t *testing.T) { api_packages: ["foo"], apex_available: [ "myapex" ], } - `, withFiles(map[string][]byte{ - "api/current.txt": nil, - "api/removed.txt": nil, - "api/system-current.txt": nil, - "api/system-removed.txt": nil, - "api/test-current.txt": nil, - "api/test-removed.txt": nil, - })) + `, withFiles(filesForSdkLibrary)) // java_sdk_library installs both impl jar and permission XML ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{ @@ -4295,6 +4298,98 @@ func TestJavaSDKLibrary(t *testing.T) { ensureContains(t, sdkLibrary.RuleParams.Command, `