diff options
author | Jiyong Park <jiyong@google.com> | 2019-08-19 14:56:02 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2019-08-29 13:57:32 +0900 |
commit | b7c639e0b3593eaf58393ee679732eeeb357865d (patch) | |
tree | 006a19b0077df2e019e704b15763bfa5b65172c8 /java/app.go | |
parent | 63cce391665117abc509b9938aaac0b1ce780b8e (diff) | |
download | build_soong-b7c639e0b3593eaf58393ee679732eeeb357865d.tar.gz build_soong-b7c639e0b3593eaf58393ee679732eeeb357865d.tar.bz2 build_soong-b7c639e0b3593eaf58393ee679732eeeb357865d.zip |
Prepare to be able to put framework-res in srcs
This change introduces two changes required to put
framework-res explicitly in srcs property, without relying on the build
system to specially add framework-res as a dependency to
framework-minus-apex, etc.
1) R.java and Manifest.java generated from aapt were packaged to the file
R.jar directly under the gen directory. With this change, the file
becomes android/R.srcjar under the gen directory.
2) android_app module now overrides OutputFileProducer interface so that
it can recognize "{.aapt.srcjar}" tag to reference the generated srcjar file.
Being able to put framework-res in srcs allows us to pass all the source
files (both in the source tree and the ones generates) via a filegroup.
Previously, the source files could only be passed via the java_library
module type. This caused a circular dependency problem when the java
library was used as an input (src_libs) of the droiddoc module. Using
filegroup eliminates the circular dependency.
Bug: 70046217
Test: m
Merged-In: I9ab6116bcc6fa3da60933d427575463b05ae69b4
(cherry picked from commit 94f37f33ed9dc5c7ad6ff901f5aa613970513ead)
Change-Id: I9ab6116bcc6fa3da60933d427575463b05ae69b4
Diffstat (limited to 'java/app.go')
-rw-r--r-- | java/app.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/java/app.go b/java/app.go index 7df4358d..0af89fd2 100644 --- a/java/app.go +++ b/java/app.go @@ -539,6 +539,15 @@ func (a *AndroidApp) getCertString(ctx android.BaseModuleContext) string { return String(a.overridableAppProperties.Certificate) } +// For OutputFileProducer interface +func (a *AndroidApp) OutputFiles(tag string) (android.Paths, error) { + switch tag { + case ".aapt.srcjar": + return []android.Path{a.aaptSrcJar}, nil + } + return a.Library.OutputFiles(tag) +} + // android_app compiles sources and Android resources into an Android application package `.apk` file. func AndroidAppFactory() android.Module { module := &AndroidApp{} |