Loading android/prebuilt.go +3 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ type prebuiltDependencyTag struct { blueprint.BaseDependencyTag } var prebuiltDepTag prebuiltDependencyTag var PrebuiltDepTag prebuiltDependencyTag type PrebuiltProperties struct { // When prefer is set to true the prebuilt will be used instead of any source module with Loading Loading @@ -127,7 +127,7 @@ func PrebuiltMutator(ctx BottomUpMutatorContext) { p := m.Prebuilt() name := m.base().BaseModuleName() if ctx.OtherModuleExists(name) { ctx.AddReverseDependency(ctx.Module(), prebuiltDepTag, name) ctx.AddReverseDependency(ctx.Module(), PrebuiltDepTag, name) p.properties.SourceExists = true } else { ctx.Rename(name) Loading @@ -147,7 +147,7 @@ func PrebuiltSelectModuleMutator(ctx TopDownMutatorContext) { p.properties.UsePrebuilt = p.usePrebuilt(ctx, nil) } } else if s, ok := ctx.Module().(Module); ok { ctx.VisitDirectDepsWithTag(prebuiltDepTag, func(m Module) { ctx.VisitDirectDepsWithTag(PrebuiltDepTag, func(m Module) { p := m.(PrebuiltInterface).Prebuilt() if p.usePrebuilt(ctx, s) { p.properties.UsePrebuilt = true Loading apex/apex.go +16 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,8 @@ type apexBundle struct { outputFiles map[apexPackaging]android.WritablePath installDir android.OutputPath prebuiltFileToDelete string public_key_file android.Path private_key_file android.Path Loading Loading @@ -862,6 +864,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { } else { ctx.ModuleErrorf("certificate dependency %q must be an android_app_certificate module", depName) } case android.PrebuiltDepTag: // If the prebuilt is force disabled, remember to delete the prebuilt file // that might have been installed in the previous builds if prebuilt, ok := child.(*Prebuilt); ok && prebuilt.isForceDisabled() { a.prebuiltFileToDelete = prebuilt.InstallFilename() } } } else { // indirect dependencies Loading Loading @@ -1362,6 +1370,10 @@ func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkD if len(a.externalDeps) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(a.externalDeps, " ")) } if a.prebuiltFileToDelete != "" { fmt.Fprintln(w, "LOCAL_POST_INSTALL_CMD :=", "rm -rf "+ filepath.Join("$(OUT_DIR)", a.installDir.RelPathString(), a.prebuiltFileToDelete)) } fmt.Fprintln(w, "include $(BUILD_PREBUILT)") if apexType == imageApex { Loading Loading @@ -1517,6 +1529,10 @@ func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) { p.properties.Source = src } func (p *Prebuilt) isForceDisabled() bool { return p.properties.ForceDisable } func (p *Prebuilt) OutputFiles(tag string) (android.Paths, error) { switch tag { case "": Loading Loading
android/prebuilt.go +3 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ type prebuiltDependencyTag struct { blueprint.BaseDependencyTag } var prebuiltDepTag prebuiltDependencyTag var PrebuiltDepTag prebuiltDependencyTag type PrebuiltProperties struct { // When prefer is set to true the prebuilt will be used instead of any source module with Loading Loading @@ -127,7 +127,7 @@ func PrebuiltMutator(ctx BottomUpMutatorContext) { p := m.Prebuilt() name := m.base().BaseModuleName() if ctx.OtherModuleExists(name) { ctx.AddReverseDependency(ctx.Module(), prebuiltDepTag, name) ctx.AddReverseDependency(ctx.Module(), PrebuiltDepTag, name) p.properties.SourceExists = true } else { ctx.Rename(name) Loading @@ -147,7 +147,7 @@ func PrebuiltSelectModuleMutator(ctx TopDownMutatorContext) { p.properties.UsePrebuilt = p.usePrebuilt(ctx, nil) } } else if s, ok := ctx.Module().(Module); ok { ctx.VisitDirectDepsWithTag(prebuiltDepTag, func(m Module) { ctx.VisitDirectDepsWithTag(PrebuiltDepTag, func(m Module) { p := m.(PrebuiltInterface).Prebuilt() if p.usePrebuilt(ctx, s) { p.properties.UsePrebuilt = true Loading
apex/apex.go +16 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,8 @@ type apexBundle struct { outputFiles map[apexPackaging]android.WritablePath installDir android.OutputPath prebuiltFileToDelete string public_key_file android.Path private_key_file android.Path Loading Loading @@ -862,6 +864,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { } else { ctx.ModuleErrorf("certificate dependency %q must be an android_app_certificate module", depName) } case android.PrebuiltDepTag: // If the prebuilt is force disabled, remember to delete the prebuilt file // that might have been installed in the previous builds if prebuilt, ok := child.(*Prebuilt); ok && prebuilt.isForceDisabled() { a.prebuiltFileToDelete = prebuilt.InstallFilename() } } } else { // indirect dependencies Loading Loading @@ -1362,6 +1370,10 @@ func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkD if len(a.externalDeps) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(a.externalDeps, " ")) } if a.prebuiltFileToDelete != "" { fmt.Fprintln(w, "LOCAL_POST_INSTALL_CMD :=", "rm -rf "+ filepath.Join("$(OUT_DIR)", a.installDir.RelPathString(), a.prebuiltFileToDelete)) } fmt.Fprintln(w, "include $(BUILD_PREBUILT)") if apexType == imageApex { Loading Loading @@ -1517,6 +1529,10 @@ func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) { p.properties.Source = src } func (p *Prebuilt) isForceDisabled() bool { return p.properties.ForceDisable } func (p *Prebuilt) OutputFiles(tag string) (android.Paths, error) { switch tag { case "": Loading