diff options
author | Jooyung Han <jooyung@google.com> | 2021-06-03 13:56:24 +0900 |
---|---|---|
committer | Jooyung Han <jooyung@google.com> | 2021-06-04 08:49:53 +0900 |
commit | af45dbb3f33994fe7f4ee6e8374e82e92f96f705 (patch) | |
tree | 593fc6fa5acab93012d5873e98398a2aa019b2d2 /build/aidl_utils.go | |
parent | 60699b5f0010228906c13f288ae37077c326deb3 (diff) | |
download | aidl-af45dbb3f33994fe7f4ee6e8374e82e92f96f705.tar.gz |
refactor: use getPaths() instead of getBaseDir()
getPaths() now supports filegroup/genrule/etc and returns src paths
which consist of "basedir + rel".
Bug: 189288369
Test: m
Change-Id: I9af0fe23b4c334d947c5d51c432acfaf2e0cdeb5
Diffstat (limited to 'build/aidl_utils.go')
-rw-r--r-- | build/aidl_utils.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/build/aidl_utils.go b/build/aidl_utils.go index b19793c2..4e0fba90 100644 --- a/build/aidl_utils.go +++ b/build/aidl_utils.go @@ -15,7 +15,6 @@ package aidl import ( - "android/soong/android" "strings" ) @@ -46,22 +45,6 @@ func concat(sstrs ...[]string) []string { return ret } -// baseDir is the directory where the package name starts. e.g. For an AIDL fil -// mymodule/aidl_src/com/android/IFoo.aidl, baseDir is mymodule/aidl_src given that the package name is -// com.android. The build system however don't know the package name without actually reading the AIDL file. -// Therefore, we rely on the user to correctly set the base directory via following two methods: -// 1) via the 'path' property of filegroup or -// 2) via `local_include_dir' of the aidl_interface module. -func getBaseDir(ctx android.ModuleContext, src android.Path, aidlRoot android.Path) string { - // By default, we try to get 1) by reading Rel() of the input path. - baseDir := strings.TrimSuffix(src.String(), src.Rel()) - // However, if 2) is set and it's more specific (i.e. deeper) than 1), we use 2). - if strings.HasPrefix(aidlRoot.String(), baseDir) { - baseDir = aidlRoot.String() - } - return baseDir -} - func fixRustName(name string) string { return strings.Map(func(r rune) rune { switch r { |