Loading apex/androidmk.go +1 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo // we need to remove the suffix from LOCAL_MODULE_STEM, otherwise // we will have foo.jar.jar fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", strings.TrimSuffix(fi.Stem(), ".jar")) if javaModule, ok := fi.module.(java.Dependency); ok { if javaModule, ok := fi.module.(java.ApexDependency); ok { fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", javaModule.ImplementationAndResourcesJars()[0].String()) fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", javaModule.HeaderJars()[0].String()) } else { Loading apex/apex.go +3 −1 Original line number Diff line number Diff line Loading @@ -1652,7 +1652,9 @@ type javaDependency interface { func apexFileForJavaLibrary(ctx android.BaseModuleContext, lib javaDependency, module android.Module) apexFile { dirInApex := "javalib" fileToCopy := lib.DexJarBuildPath() af := newApexFile(ctx, fileToCopy, module.Name(), dirInApex, javaSharedLib, module) // Remove prebuilt_ if necessary so the source and prebuilt modules have the same name. name := strings.TrimPrefix(module.Name(), "prebuilt_") af := newApexFile(ctx, fileToCopy, name, dirInApex, javaSharedLib, module) af.jacocoReportClassesFile = lib.JacocoReportClassesFile() af.stem = lib.Stem() + ".jar" return af Loading java/java.go +7 −2 Original line number Diff line number Diff line Loading @@ -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 Loading java/sdk_library.go +20 −0 Original line number Diff line number Diff line Loading @@ -1999,6 +1999,26 @@ func (module *SdkLibraryImport) Stem() string { return module.BaseModuleName() } var _ ApexDependency = (*SdkLibraryImport)(nil) // to satisfy java.ApexDependency interface func (module *SdkLibraryImport) HeaderJars() android.Paths { if module.implLibraryModule == nil { return nil } else { return module.implLibraryModule.HeaderJars() } } // to satisfy java.ApexDependency interface func (module *SdkLibraryImport) ImplementationAndResourcesJars() android.Paths { if module.implLibraryModule == nil { return nil } else { return module.implLibraryModule.ImplementationAndResourcesJars() } } // // java_sdk_library_xml // Loading Loading
apex/androidmk.go +1 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo // we need to remove the suffix from LOCAL_MODULE_STEM, otherwise // we will have foo.jar.jar fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", strings.TrimSuffix(fi.Stem(), ".jar")) if javaModule, ok := fi.module.(java.Dependency); ok { if javaModule, ok := fi.module.(java.ApexDependency); ok { fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", javaModule.ImplementationAndResourcesJars()[0].String()) fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", javaModule.HeaderJars()[0].String()) } else { Loading
apex/apex.go +3 −1 Original line number Diff line number Diff line Loading @@ -1652,7 +1652,9 @@ type javaDependency interface { func apexFileForJavaLibrary(ctx android.BaseModuleContext, lib javaDependency, module android.Module) apexFile { dirInApex := "javalib" fileToCopy := lib.DexJarBuildPath() af := newApexFile(ctx, fileToCopy, module.Name(), dirInApex, javaSharedLib, module) // Remove prebuilt_ if necessary so the source and prebuilt modules have the same name. name := strings.TrimPrefix(module.Name(), "prebuilt_") af := newApexFile(ctx, fileToCopy, name, dirInApex, javaSharedLib, module) af.jacocoReportClassesFile = lib.JacocoReportClassesFile() af.stem = lib.Stem() + ".jar" return af Loading
java/java.go +7 −2 Original line number Diff line number Diff line Loading @@ -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 Loading
java/sdk_library.go +20 −0 Original line number Diff line number Diff line Loading @@ -1999,6 +1999,26 @@ func (module *SdkLibraryImport) Stem() string { return module.BaseModuleName() } var _ ApexDependency = (*SdkLibraryImport)(nil) // to satisfy java.ApexDependency interface func (module *SdkLibraryImport) HeaderJars() android.Paths { if module.implLibraryModule == nil { return nil } else { return module.implLibraryModule.HeaderJars() } } // to satisfy java.ApexDependency interface func (module *SdkLibraryImport) ImplementationAndResourcesJars() android.Paths { if module.implLibraryModule == nil { return nil } else { return module.implLibraryModule.ImplementationAndResourcesJars() } } // // java_sdk_library_xml // Loading