diff options
| author | 2023-05-17 00:23:38 +0000 | |
|---|---|---|
| committer | 2023-05-17 01:02:19 +0000 | |
| commit | 795319fadb84b4e65c9fb3defbaf25b612acd53b (patch) | |
| tree | 9ed915c5e2230230ee6e274a0edc1e6938ea418f /java/java.go | |
| parent | 7754be760a6f29cd25e8486ab5373b37c9c474a2 (diff) | |
Disallow missing api source files for java_api_library module
The purpose of this change is to enable filegroups to be taken as inputs
for `java_api_library` module `api_files` property. However, since
android.MaybeExistentPathForSource() does not support this, it needs to
be replaced with android.PathForModuleSrc(), which checks for the files'
existence.
Bug: 283006953
Test: go test ./java
Change-Id: I8a7d7f200f900219cc17243194a4c26071329ee6
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/java/java.go b/java/java.go index a98762cf1..44ff715b4 100644 --- a/java/java.go +++ b/java/java.go @@ -1651,7 +1651,7 @@ type JavaApiLibraryProperties struct { // list of api.txt files relative to this directory that contribute to the // API surface. // This is a list of relative paths - Api_files []string + Api_files []string `android:"path"` // List of flags to be passed to the javac compiler to generate jar file Javacflags []string @@ -1833,9 +1833,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Add the api_files inputs for _, api := range al.properties.Api_files { - // Use MaybeExistentPathForSource since the api file might not exist during analysis. - // This will be provided by the orchestrator in the combined execution. - srcFiles = append(srcFiles, android.MaybeExistentPathForSource(ctx, ctx.ModuleDir(), api)) + srcFiles = append(srcFiles, android.PathForModuleSrc(ctx, api)) } if srcFiles == nil { |