summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2020-06-17 16:59:43 +0100
committerPaul Duffin <paulduffin@google.com>2020-06-17 16:59:43 +0100
commit44b481b81bff20fc530b00859852d40d726663c6 (patch)
treed33a0e3c0a8491dba363dcb92e2535fad3146f82 /java/java.go
parentd82599033680ac26c4ffce2373ddce5f67c990d1 (diff)
Fix check-boot-jars when a boot jar is provided by prebuilt
Previously, when a boot jar was provided by a java_sdk_library_import module the check-boot-jars check failed because the file it depended on was not available. In an incremental build the build failed due to the file in the out directory not having a rule to generate it. That was because the module was named prebuilt_<module>.<apex> instead of <module>.<apex>. This was fixed by simply removing prebuilt_ prefix from the name if it was present. After fixing that the check-boot-jars still did not work properly because it was expecting a jar file containing .class files but instead was given a jar file containing .dex files which meant the check did not work properly. This was fixed by defining a new ApexDependency interface for use by the apex/apex.go code to use instead of java.Dependency for generating the androidmk entries. The *SdkLibraryImport type then implemented those, by delegating to the implementation library. Bug: 158304459 Bug: 159112414 Test: m check-boot-jars m checkbuild manual inspection of the .jar file used by check-boot-jars to ensure it contained .class files and not .dex files. Change-Id: I545c5c9072dd472337d2f9b4dfdf08f53c981662
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go
index bd5f6b7d5..d7f09f970 100644
--- a/java/java.go
+++ b/java/java.go
@@ -496,11 +496,16 @@ func (j *Module) OutputFiles(tag string) (android.Paths, error) {
var _ android.OutputFileProducer = (*Module)(nil)
-type Dependency interface {
+// Methods that need to be implemented for a module that is added to apex java_libs property.
+type ApexDependency interface {
HeaderJars() android.Paths
+ ImplementationAndResourcesJars() android.Paths
+}
+
+type Dependency interface {
+ ApexDependency
ImplementationJars() android.Paths
ResourceJars() android.Paths
- ImplementationAndResourcesJars() android.Paths
DexJarBuildPath() android.Path
DexJarInstallPath() android.Path
AidlIncludeDirs() android.Paths