diff options
Diffstat (limited to 'java')
| -rw-r--r-- | java/base.go | 10 | ||||
| -rw-r--r-- | java/container_test.go | 37 | ||||
| -rw-r--r-- | java/testing.go | 10 |
3 files changed, 55 insertions, 2 deletions
diff --git a/java/base.go b/java/base.go index c601cf536..4ab82c58f 100644 --- a/java/base.go +++ b/java/base.go @@ -574,8 +574,14 @@ type Module struct { var _ android.InstallableModule = (*Module)(nil) // To satisfy the InstallableModule interface -func (j *Module) EnforceApiContainerChecks() bool { - return true +func (j *Module) StaticDependencyTags() []blueprint.DependencyTag { + return []blueprint.DependencyTag{staticLibTag} +} + +// To satisfy the InstallableModule interface +func (j *Module) DynamicDependencyTags() []blueprint.DependencyTag { + return []blueprint.DependencyTag{libTag, sdkLibTag, bootClasspathTag, systemModulesTag, + instrumentationForTag, java9LibTag} } // Overrides android.ModuleBase.InstallInProduct() diff --git a/java/container_test.go b/java/container_test.go index 344185553..25cfa4c7e 100644 --- a/java/container_test.go +++ b/java/container_test.go @@ -65,6 +65,18 @@ func TestJavaContainersModuleProperties(t *testing.T) { "general-tests", ], } + java_library { + name: "bar", + static_libs: [ + "framework-minus-apex", + ], + } + java_library { + name: "baz", + static_libs: [ + "bar", + ], + } `) testcases := []struct { @@ -73,6 +85,7 @@ func TestJavaContainersModuleProperties(t *testing.T) { isVendorContainer bool isProductContainer bool isCts bool + isUnstable bool }{ { moduleName: "foo", @@ -80,6 +93,7 @@ func TestJavaContainersModuleProperties(t *testing.T) { isVendorContainer: false, isProductContainer: false, isCts: false, + isUnstable: false, }, { moduleName: "foo_vendor", @@ -87,6 +101,7 @@ func TestJavaContainersModuleProperties(t *testing.T) { isVendorContainer: true, isProductContainer: false, isCts: false, + isUnstable: false, }, { moduleName: "foo_soc_specific", @@ -94,6 +109,7 @@ func TestJavaContainersModuleProperties(t *testing.T) { isVendorContainer: true, isProductContainer: false, isCts: false, + isUnstable: false, }, { moduleName: "foo_product_specific", @@ -101,6 +117,7 @@ func TestJavaContainersModuleProperties(t *testing.T) { isVendorContainer: false, isProductContainer: true, isCts: false, + isUnstable: false, }, { moduleName: "foo_cts_test", @@ -108,6 +125,7 @@ func TestJavaContainersModuleProperties(t *testing.T) { isVendorContainer: false, isProductContainer: false, isCts: true, + isUnstable: false, }, { moduleName: "foo_non_cts_test", @@ -115,6 +133,23 @@ func TestJavaContainersModuleProperties(t *testing.T) { isVendorContainer: false, isProductContainer: false, isCts: false, + isUnstable: false, + }, + { + moduleName: "bar", + isSystemContainer: true, + isVendorContainer: false, + isProductContainer: false, + isCts: false, + isUnstable: true, + }, + { + moduleName: "baz", + isSystemContainer: true, + isVendorContainer: false, + isProductContainer: false, + isCts: false, + isUnstable: true, }, } @@ -125,5 +160,7 @@ func TestJavaContainersModuleProperties(t *testing.T) { checkContainerMatch(t, c.moduleName, "system", c.isSystemContainer, android.InList(android.SystemContainer, belongingContainers)) checkContainerMatch(t, c.moduleName, "vendor", c.isVendorContainer, android.InList(android.VendorContainer, belongingContainers)) checkContainerMatch(t, c.moduleName, "product", c.isProductContainer, android.InList(android.ProductContainer, belongingContainers)) + checkContainerMatch(t, c.moduleName, "cts", c.isCts, android.InList(android.CtsContainer, belongingContainers)) + checkContainerMatch(t, c.moduleName, "unstable", c.isUnstable, android.InList(android.UnstableContainer, belongingContainers)) } } diff --git a/java/testing.go b/java/testing.go index e1bf5376e..0e85022ce 100644 --- a/java/testing.go +++ b/java/testing.go @@ -542,6 +542,16 @@ func gatherRequiredDepsForTest() string { }, compile_dex: true, } + java_library { + name: "framework-minus-apex", + srcs: ["a.java"], + sdk_version: "none", + system_modules: "stable-core-platform-api-stubs-system-modules", + aidl: { + export_include_dirs: ["framework/aidl"], + }, + compile_dex: true, + } android_app { name: "framework-res", |