summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2022-06-27 16:00:26 -0400
committer Ante Culo <cante@google.com> 2022-08-16 19:46:25 +0000
commitbe6873f8134508350972f87fd96a5db7c965c148 (patch)
tree8641c240aad161a09cb8a82852ff207c5014e2fc
parent9bcfe69743f227c6e10f5830d735835529b0c1c0 (diff)
rust: Allow rust_ffi_shared in jni_libs
Allow listing rust_ffi_shared modules as a jni_libs dependency in conjunction with platform_api: true. This allows inclusion by android_app modules. Bug: 237304791 Test: android_app module builds with a rust_ffi_shared dependency. Change-Id: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1 Merged-In: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1
-rw-r--r--cc/linkable.go9
-rwxr-xr-xjava/app.go2
-rw-r--r--rust/rust.go13
3 files changed, 23 insertions, 1 deletions
diff --git a/cc/linkable.go b/cc/linkable.go
index 6bec30c54..bad4b4ab9 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -113,6 +113,9 @@ type LinkableInterface interface {
UnstrippedOutputFile() android.Path
CoverageFiles() android.Paths
+ // CoverageOutputFile returns the output archive of gcno coverage information files.
+ CoverageOutputFile() android.OptionalPath
+
NonCcVariants() bool
SelectedStl() string
@@ -140,6 +143,12 @@ type LinkableInterface interface {
UseSdk() bool
+ // IsNdk returns true if the library is in the configs known NDK list.
+ IsNdk(config android.Config) bool
+
+ // IsStubs returns true if the this is a stubs library.
+ IsStubs() bool
+
// IsLlndk returns true for both LLNDK (public) and LLNDK-private libs.
IsLlndk() bool
diff --git a/java/app.go b/java/app.go
index 41419ba78..2a455de30 100755
--- a/java/app.go
+++ b/java/app.go
@@ -749,7 +749,7 @@ func collectAppDeps(ctx android.ModuleContext, app appDepsInterface,
tag := ctx.OtherModuleDependencyTag(module)
if IsJniDepTag(tag) || cc.IsSharedDepTag(tag) {
- if dep, ok := module.(*cc.Module); ok {
+ if dep, ok := module.(cc.LinkableInterface); ok {
if dep.IsNdk(ctx.Config()) || dep.IsStubs() {
return false
}
diff --git a/rust/rust.go b/rust/rust.go
index c4fd14859..7c644dd92 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -682,6 +682,19 @@ func (mod *Module) CoverageFiles() android.Paths {
panic(fmt.Errorf("CoverageFiles called on non-library module: %q", mod.BaseModuleName()))
}
+// Rust does not produce gcno files, and therefore does not produce a coverage archive.
+func (mod *Module) CoverageOutputFile() android.OptionalPath {
+ return android.OptionalPath{}
+}
+
+func (mod *Module) IsNdk(config android.Config) bool {
+ return false
+}
+
+func (mod *Module) IsStubs() bool {
+ return false
+}
+
func (mod *Module) installable(apexInfo android.ApexInfo) bool {
if !proptools.BoolDefault(mod.Installable(), mod.EverInstallable()) {
return false