Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e63a8e7 authored by Anton Hansson's avatar Anton Hansson Committed by Gerrit Code Review
Browse files

Merge "Fix check-boot-jars when a boot jar is provided by prebuilt"

parents a4e8a640 44b481b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+3 −1
Original line number Diff line number Diff line
@@ -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
+7 −2
Original line number Diff line number Diff line
@@ -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
+20 −0
Original line number Diff line number Diff line
@@ -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
//