Enable certificate overrides with product vars.
Currently it is only for android_app, though it can be easily ported to apex. The make-side change will be made later, along with a real application. Bug: 122957760 Test: app_test.go Change-Id: I41f0be84f8b9f93e9518a16160e10eaa649388cd
This commit is contained in:
12
java/app.go
12
java/app.go
@@ -120,7 +120,7 @@ func (a *AndroidApp) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
ctx.AddFarVariationDependencies(variation, tag, a.appProperties.Jni_libs...)
|
||||
}
|
||||
|
||||
cert := android.SrcIsModule(String(a.appProperties.Certificate))
|
||||
cert := android.SrcIsModule(a.getCertString(ctx))
|
||||
if cert != "" {
|
||||
ctx.AddDependency(ctx.Module(), certificateTag, cert)
|
||||
}
|
||||
@@ -241,7 +241,7 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
return
|
||||
}
|
||||
|
||||
cert := String(a.appProperties.Certificate)
|
||||
cert := a.getCertString(ctx)
|
||||
certModule := android.SrcIsModule(cert)
|
||||
if certModule != "" {
|
||||
a.certificate = certificateDeps[0]
|
||||
@@ -327,6 +327,14 @@ func (a *AndroidApp) collectAppDeps(ctx android.ModuleContext) ([]jniLib, []Cert
|
||||
return jniLibs, certificates
|
||||
}
|
||||
|
||||
func (a *AndroidApp) getCertString(ctx android.BaseContext) string {
|
||||
certificate, overridden := ctx.DeviceConfig().OverrideCertificateFor(ctx.ModuleName())
|
||||
if overridden {
|
||||
return ":" + certificate
|
||||
}
|
||||
return String(a.appProperties.Certificate)
|
||||
}
|
||||
|
||||
func AndroidAppFactory() android.Module {
|
||||
module := &AndroidApp{}
|
||||
|
||||
|
Reference in New Issue
Block a user