aboutsummaryrefslogtreecommitdiffstats
path: root/apex/apex.go
diff options
context:
space:
mode:
authorKevin F. Haggerty <haggertk@lineageos.org>2020-06-01 21:06:21 -0600
committerKevin F. Haggerty <haggertk@lineageos.org>2020-06-01 21:06:21 -0600
commit418b5a60d6f98e2fc34a217251a6b04dbe8fb3ab (patch)
tree3a4e9942c65c7925803598f4665a5c681afa6367 /apex/apex.go
parent4dac9eee3f43e0fa62015d6f7a318ec05f63bc63 (diff)
parenta4f4c0d08088a3bd8d00257e058d1bdfc093b1f8 (diff)
downloadandroid_build_soong-lineage-17.1.tar.gz
android_build_soong-lineage-17.1.tar.bz2
android_build_soong-lineage-17.1.zip
Merge tag 'android-10.0.0_r37' into staging/lineage-17.1_merge-android-10.0.0_r37HEADlineage-17.1
Android 10.0.0 Release 37 (QQ3A.200605.001) * tag 'android-10.0.0_r37': Wrap getenv when linking a coverage-enabled binary Refactor libprofile-extras to be added as a whole static library Package coverage files as a zip. Build native coverage variant of APEXes when needed Change-Id: I89b49b7f720021e528ad51ef2be9554e06189904
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go32
1 files changed, 29 insertions, 3 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 5bbc82c9..1e1c33a7 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -267,6 +267,10 @@ type apexBundleProperties struct {
// List of sanitizer names that this APEX is enabled for
SanitizerNames []string `blueprint:"mutated"`
+
+ PreventInstall bool `blueprint:"mutated"`
+
+ HideFromMake bool `blueprint:"mutated"`
}
type apexTargetBundleProperties struct {
@@ -560,7 +564,7 @@ func (a *apexBundle) Srcs() android.Paths {
}
func (a *apexBundle) installable() bool {
- return a.properties.Installable == nil || proptools.Bool(a.properties.Installable)
+ return !a.properties.PreventInstall && (a.properties.Installable == nil || proptools.Bool(a.properties.Installable))
}
func (a *apexBundle) getImageVariation(config android.DeviceConfig) string {
@@ -595,6 +599,18 @@ func (a *apexBundle) IsSanitizerEnabled(ctx android.BaseModuleContext, sanitizer
return android.InList(sanitizerName, globalSanitizerNames)
}
+func (a *apexBundle) IsNativeCoverageNeeded(ctx android.BaseContext) bool {
+ return ctx.Device() && ctx.DeviceConfig().NativeCoverageEnabled()
+}
+
+func (a *apexBundle) PreventInstall() {
+ a.properties.PreventInstall = true
+}
+
+func (a *apexBundle) HideFromMake() {
+ a.properties.HideFromMake = true
+}
+
func getCopyManifestForNativeLibrary(cc *cc.Module, handleSpecialLibs bool) (fileToCopy android.Path, dirInApex string) {
// Decide the APEX-local directory by the multilib of the library
// In the future, we may query this to the module.
@@ -1094,6 +1110,11 @@ func (a *apexBundle) buildFlattenedApex(ctx android.ModuleContext) {
}
func (a *apexBundle) AndroidMk() android.AndroidMkData {
+ if a.properties.HideFromMake {
+ return android.AndroidMkData{
+ Disabled: true,
+ }
+ }
writers := []android.AndroidMkData{}
if a.apexTypes.image() {
writers = append(writers, a.androidMkForType(imageApex))
@@ -1183,8 +1204,13 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, name, moduleDir string, apex
fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_java_prebuilt.mk")
} else if fi.class == nativeSharedLib || fi.class == nativeExecutable {
fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", fi.builtFile.Base())
- if cc, ok := fi.module.(*cc.Module); ok && cc.UnstrippedOutputFile() != nil {
- fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", cc.UnstrippedOutputFile().String())
+ if cc, ok := fi.module.(*cc.Module); ok {
+ if cc.UnstrippedOutputFile() != nil {
+ fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", cc.UnstrippedOutputFile().String())
+ }
+ if cc.CoverageOutputFile().Valid() {
+ fmt.Fprintln(w, "LOCAL_PREBUILT_COVERAGE_ARCHIVE :=", cc.CoverageOutputFile().String())
+ }
}
fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_cc_prebuilt.mk")
} else {