diff options
| author | Treehugger Robot <treehugger-gerrit@google.com> | 2019-02-21 00:02:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-02-21 00:02:08 +0000 |
| commit | 1455d47788ae30ad3ae9517bb1df03c822fd7db5 (patch) | |
| tree | 59df3b0b60e2379831907bea666aa8b42d58fc07 /apex | |
| parent | 55f8c42a7b761c4669f9fe242bc35acc8bc12b0c (diff) | |
| parent | ac2bacd418b0813cfdbe82af7ff21ca19e57d665 (diff) | |
| download | build_soong-1455d47788ae30ad3ae9517bb1df03c822fd7db5.tar.gz build_soong-1455d47788ae30ad3ae9517bb1df03c822fd7db5.tar.bz2 build_soong-1455d47788ae30ad3ae9517bb1df03c822fd7db5.zip | |
Merge "Install external deps of an APEX"
Diffstat (limited to 'apex')
| -rw-r--r-- | apex/apex.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apex/apex.go b/apex/apex.go index 408415eb..86393377 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -389,6 +389,9 @@ type apexBundle struct { // list of files to be included in this apex filesInfo []apexFile + // list of module names that this APEX is depending on + externalDeps []string + flattened bool testApex bool @@ -731,6 +734,14 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { if am, ok := child.(android.ApexModule); ok && am.CanHaveApexVariants() && am.IsInstallableToApex() { if cc, ok := child.(*cc.Module); ok { if cc.IsStubs() || cc.HasStubsVariants() { + // If the dependency is a stubs lib, don't include it in this APEX, + // but make sure that the lib is installed on the device. + // In case no APEX is having the lib, the lib is installed to the system + // partition. + if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.Name(), a.externalDeps) { + a.externalDeps = append(a.externalDeps, cc.Name()) + } + // Don't track further return false } depName := ctx.OtherModuleName(child) @@ -1126,6 +1137,9 @@ func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkD if len(moduleNames) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(moduleNames, " ")) } + if len(a.externalDeps) > 0 { + fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(a.externalDeps, " ")) + } fmt.Fprintln(w, "include $(BUILD_PREBUILT)") if apexType == imageApex { |
