Dedup generating xml file for java_sdk_library

Permission XML file for java_sdk_library is generated by
java_sdk_library itself now.

And, build rule is switched to android.WriteFile since "echo -e" is
not supported from build server. (-e is printed to output)

Bug: 145474221
Test: m com.android.cronet and check its permissions xml file
     also, m org.chromium.net.cronet.xml (created dynamically)
Change-Id: Iffb119151c49bc4fe6c4386fa267cca193f37dbc
This commit is contained in:
Jooyung Han
2019-12-24 18:38:06 +09:00
parent 29d1336d11
commit 624058e6a5
3 changed files with 44 additions and 54 deletions

View File

@@ -3288,8 +3288,8 @@ func TestJavaSDKLibrary(t *testing.T) {
"etc/permissions/foo.xml",
})
// Permission XML should point to the activated path of impl jar of java_sdk_library
genXMLCommand := ctx.ModuleForTests("foo", "android_common_myapex").Output("foo.xml").RuleParams.Command
ensureContains(t, genXMLCommand, `<library name="foo" file="/apex/myapex/javalib/foo.jar"`)
xml := ctx.ModuleForTests("foo", "android_common_myapex").Output("foo.xml")
ensureContains(t, xml.Args["content"], `<library name="foo" file="/apex/myapex/javalib/foo.jar"`)
}
func TestRejectNonInstallableJavaLibrary(t *testing.T) {