diff options
Diffstat (limited to 'apex')
-rw-r--r-- | apex/apex.go | 3 | ||||
-rw-r--r-- | apex/apex_test.go | 33 |
2 files changed, 35 insertions, 1 deletions
diff --git a/apex/apex.go b/apex/apex.go index f6daf9bf..eb791d93 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -540,6 +540,7 @@ func getCopyManifestForNativeLibrary(cc *cc.Module, handleSpecialLibs bool) (fil case "lib64": dirInApex = "lib64" } + dirInApex = filepath.Join(dirInApex, cc.RelativeInstallPath()) if !cc.Arch().Native { dirInApex = filepath.Join(dirInApex, cc.Arch().ArchType.String()) } @@ -564,6 +565,8 @@ func getCopyManifestForNativeLibrary(cc *cc.Module, handleSpecialLibs bool) (fil } func getCopyManifestForExecutable(cc *cc.Module) (fileToCopy android.Path, dirInApex string) { + // TODO(b/123721777) respect relative_install_path also for binaries + // dirInApex = filepath.Join("bin", cc.RelativeInstallPath()) dirInApex = "bin" fileToCopy = cc.OutputFile().Path() return diff --git a/apex/apex_test.go b/apex/apex_test.go index 9d330608..1315c25d 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -615,7 +615,10 @@ func TestFilesInSubDir(t *testing.T) { apex { name: "myapex", key: "myapex.key", + native_shared_libs: ["mylib"], + binaries: ["mybin"], prebuilts: ["myetc"], + compile_multilib: "both", } apex_key { @@ -629,15 +632,43 @@ func TestFilesInSubDir(t *testing.T) { src: "myprebuilt", sub_dir: "foo/bar", } + + cc_library { + name: "mylib", + srcs: ["mylib.cpp"], + relative_install_path: "foo/bar", + system_shared_libs: [], + stl: "none", + } + + cc_binary { + name: "mybin", + srcs: ["mylib.cpp"], + relative_install_path: "foo/bar", + system_shared_libs: [], + static_executable: true, + stl: "none", + } `) generateFsRule := ctx.ModuleForTests("myapex", "android_common_myapex").Rule("generateFsConfig") dirs := strings.Split(generateFsRule.Args["exec_paths"], " ") - // Ensure that etc, etc/foo, and etc/foo/bar are all listed + // Ensure that the subdirectories are all listed ensureListContains(t, dirs, "etc") ensureListContains(t, dirs, "etc/foo") ensureListContains(t, dirs, "etc/foo/bar") + ensureListContains(t, dirs, "lib64") + ensureListContains(t, dirs, "lib64/foo") + ensureListContains(t, dirs, "lib64/foo/bar") + ensureListContains(t, dirs, "lib") + ensureListContains(t, dirs, "lib/foo") + ensureListContains(t, dirs, "lib/foo/bar") + + // TODO(b/123721777) respect relative path for binaries + // ensureListContains(t, dirs, "bin") + // ensureListContains(t, dirs, "bin/foo") + // ensureListContains(t, dirs, "bin/foo/bar") } func TestUseVendor(t *testing.T) { |