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
diff --git a/apex/apex.go b/apex/apex.go
index e0ee1ea..48957c2 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1024,12 +1024,12 @@
}
filesInfo = append(filesInfo, af)
- pf := sdkLib.PermissionFile()
- if pf == nil {
+ pf, _ := sdkLib.OutputFiles(".xml")
+ if len(pf) != 1 {
ctx.PropertyErrorf("java_libs", "%q failed to generate permission XML", depName)
return false
}
- filesInfo = append(filesInfo, newApexFile(ctx, pf, pf.Base(), "etc/permissions", etc, nil))
+ filesInfo = append(filesInfo, newApexFile(ctx, pf[0], pf[0].Base(), "etc/permissions", etc, nil))
return true // track transitive dependencies
} else {
ctx.PropertyErrorf("java_libs", "%q of type %q is not supported", depName, ctx.OtherModuleType(child))