framework-wifi: default build rule for tests

Create a java_default build rule for tests that
need to build against @hide APIs from
framework-wifi.

Visibility is restricted to select tests for now.

Also restricted visibility for framework-wifi
itself.

Bug: 146513037
Test: compiles
Change-Id: Ia6dec8cf0202e0417d54a480c1715190b03e5e3e
This commit is contained in:
David Su
2019-12-18 18:20:28 -08:00
parent 5eac974c59
commit 90ed10582d

View File

@@ -43,11 +43,19 @@ filegroup {
srcs: ["java/android/net/wifi/WifiAnnotations.java"],
}
// list of tests that are allowed to access @hide APIs from framework-wifi
test_access_hidden_api_whitelist = [
"//frameworks/base/wifi/tests",
"//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
]
java_library {
name: "framework-wifi",
sdk_version: "core_platform", // TODO(b/140299412) should be core_current
// TODO(b/140299412) should be core_current once we build against framework-system-stubs
sdk_version: "core_platform",
libs: [
"framework-minus-apex", // TODO(b/140299412) should be framework-system-stubs
// TODO(b/140299412) should be framework-system-stubs once we fix all @hide dependencies
"framework-minus-apex",
],
srcs: [
":framework-wifi-updatable-sources",
@@ -55,7 +63,11 @@ java_library {
installable: true,
optimize: {
enabled: false
}
},
visibility: [
"//frameworks/base", // TODO(b/140299412) remove once all dependencies are fixed
"//frameworks/opt/net/wifi/service:__subpackages__",
] + test_access_hidden_api_whitelist,
}
droidstubs {
@@ -85,3 +97,16 @@ java_library {
installable: false,
}
// defaults for tests that need to build against framework-wifi's @hide APIs
java_defaults {
name: "framework-wifi-test-defaults",
sdk_version: "core_platform", // tests can use @CorePlatformApi's
libs: [
"framework-wifi",
"framework-minus-apex",
// if sdk_version="" this gets automatically included, but here we need to add manually.
"framework-res",
],
visibility: test_access_hidden_api_whitelist,
}