aboutsummaryrefslogtreecommitdiffstats
path: root/sysprop
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2020-03-30 18:00:25 +0100
committerPaul Duffin <paulduffin@google.com>2020-04-22 12:51:48 +0100
commitebb7af6969cfe8328d9ae4214f697af9a9eef22c (patch)
tree1db4addc3b31743dfcbcef122e94f176a675a437 /sysprop
parent868ecfde70a7f83fd904431415f5bf7f55843b17 (diff)
downloadbuild_soong-ebb7af6969cfe8328d9ae4214f697af9a9eef22c.tar.gz
build_soong-ebb7af6969cfe8328d9ae4214f697af9a9eef22c.tar.bz2
build_soong-ebb7af6969cfe8328d9ae4214f697af9a9eef22c.zip
Add apex_available to sysprop_library
Added apex_available support to sysprop_library and copied it onto the underlying cc_library. Bug: 152762638 Bug: 153306490 Test: m nothing Merged-In: I8f4c539532b48f3a45c1fbf0f7287db11df69d2f Change-Id: I8f4c539532b48f3a45c1fbf0f7287db11df69d2f
Diffstat (limited to 'sysprop')
-rw-r--r--sysprop/sysprop_library.go4
-rw-r--r--sysprop/sysprop_test.go10
2 files changed, 13 insertions, 1 deletions
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go
index 65dbb22a..9d492fea 100644
--- a/sysprop/sysprop_library.go
+++ b/sysprop/sysprop_library.go
@@ -115,6 +115,7 @@ func syspropJavaGenFactory() android.Module {
type syspropLibrary struct {
android.ModuleBase
+ android.ApexModuleBase
properties syspropLibraryProperties
@@ -296,6 +297,7 @@ func syspropLibraryFactory() android.Module {
&m.properties,
)
android.InitAndroidModule(m)
+ android.InitApexModule(m)
android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) })
return m
}
@@ -323,6 +325,7 @@ type ccLibraryProperties struct {
Recovery_available *bool
Vendor_available *bool
Host_supported *bool
+ Apex_available []string
}
type javaLibraryProperties struct {
@@ -411,6 +414,7 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
ccProps.Recovery_available = m.properties.Recovery_available
ccProps.Vendor_available = m.properties.Vendor_available
ccProps.Host_supported = m.properties.Host_supported
+ ccProps.Apex_available = m.ApexProperties.Apex_available
ctx.CreateModule(cc.LibraryFactory, &ccProps)
scope := "internal"
diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go
index 51da2220..85033867 100644
--- a/sysprop/sysprop_test.go
+++ b/sysprop/sysprop_test.go
@@ -15,6 +15,8 @@
package sysprop
import (
+ "reflect"
+
"android/soong/android"
"android/soong/cc"
"android/soong/java"
@@ -157,6 +159,7 @@ func TestSyspropLibrary(t *testing.T) {
ctx := test(t, `
sysprop_library {
name: "sysprop-platform",
+ apex_available: ["//apex_available:platform"],
srcs: ["android/sysprop/PlatformProperties.sysprop"],
api_packages: ["android.sysprop"],
property_owner: "Platform",
@@ -305,7 +308,12 @@ func TestSyspropLibrary(t *testing.T) {
"android_arm64_armv8-a_shared",
"android_arm64_armv8-a_static",
} {
- ctx.ModuleForTests("libsysprop-platform", variant)
+ library := ctx.ModuleForTests("libsysprop-platform", variant).Module().(*cc.Module)
+ expectedApexAvailableOnLibrary := []string{"//apex_available:platform"}
+ if !reflect.DeepEqual(library.ApexProperties.Apex_available, expectedApexAvailableOnLibrary) {
+ t.Errorf("apex available property on libsysprop-platform must be %#v, but was %#v.",
+ expectedApexAvailableOnLibrary, library.ApexProperties.Apex_available)
+ }
// core variant of vendor-owned sysprop_library is for product
ctx.ModuleForTests("libsysprop-vendor", variant)