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

Commit 3f18c55c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix missing NOTICE targets for static libs that aren't available to...

Merge "Fix missing NOTICE targets for static libs that aren't available to platform." am: e152ada4 am: b7c30e8a

Change-Id: If72192000b2eb215dec0f793db63fcec61fc9f49
parents 7e35069f b7c30e8a
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -271,6 +271,10 @@ func (library *libraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entries
			entries.SubName = "." + library.stubsVersion()
			entries.SubName = "." + library.stubsVersion()
		}
		}
		entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
		entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
			// Note library.skipInstall() has a special case to get here for static
			// libraries that otherwise would have skipped installation and hence not
			// have executed AndroidMkEntries at all. The reason is to ensure they get
			// a NOTICE file make target which other libraries might depend on.
			entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true)
			entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true)
			if library.buildStubs() {
			if library.buildStubs() {
				entries.SetBool("LOCAL_NO_NOTICE_FILE", true)
				entries.SetBool("LOCAL_NO_NOTICE_FILE", true)
+9 −0
Original line number Original line Diff line number Diff line
@@ -404,6 +404,7 @@ type installer interface {
	inSanitizerDir() bool
	inSanitizerDir() bool
	hostToolPath() android.OptionalPath
	hostToolPath() android.OptionalPath
	relativeInstallPath() string
	relativeInstallPath() string
	skipInstall(mod *Module)
}
}


type xref interface {
type xref interface {
@@ -2639,6 +2640,14 @@ func (c *Module) InstallInRecovery() bool {
	return c.InRecovery()
	return c.InRecovery()
}
}


func (c *Module) SkipInstall() {
	if c.installer == nil {
		c.ModuleBase.SkipInstall()
		return
	}
	c.installer.skipInstall(c)
}

func (c *Module) HostToolPath() android.OptionalPath {
func (c *Module) HostToolPath() android.OptionalPath {
	if c.installer == nil {
	if c.installer == nil {
		return android.OptionalPath{}
		return android.OptionalPath{}
+4 −0
Original line number Original line Diff line number Diff line
@@ -106,3 +106,7 @@ func (installer *baseInstaller) hostToolPath() android.OptionalPath {
func (installer *baseInstaller) relativeInstallPath() string {
func (installer *baseInstaller) relativeInstallPath() string {
	return String(installer.Properties.Relative_install_path)
	return String(installer.Properties.Relative_install_path)
}
}

func (installer *baseInstaller) skipInstall(mod *Module) {
	mod.ModuleBase.SkipInstall()
}
+12 −0
Original line number Original line Diff line number Diff line
@@ -1329,6 +1329,18 @@ func (library *libraryDecorator) availableFor(what string) bool {
	return android.CheckAvailableForApex(what, list)
	return android.CheckAvailableForApex(what, list)
}
}


func (library *libraryDecorator) skipInstall(mod *Module) {
	if library.static() && library.buildStatic() && !library.buildStubs() {
		// If we're asked to skip installation of a static library (in particular
		// when it's not //apex_available:platform) we still want an AndroidMk entry
		// for it to ensure we get the relevant NOTICE file targets (cf.
		// notice_files.mk) that other libraries might depend on. AndroidMkEntries
		// always sets LOCAL_UNINSTALLABLE_MODULE for these entries.
		return
	}
	mod.ModuleBase.SkipInstall()
}

var versioningMacroNamesListKey = android.NewOnceKey("versioningMacroNamesList")
var versioningMacroNamesListKey = android.NewOnceKey("versioningMacroNamesList")


func versioningMacroNamesList(config android.Config) *map[string]string {
func versioningMacroNamesList(config android.Config) *map[string]string {
+5 −0
Original line number Original line Diff line number Diff line
@@ -155,6 +155,10 @@ func (p *prebuiltLibraryLinker) disablePrebuilt() {
	p.properties.Srcs = nil
	p.properties.Srcs = nil
}
}


func (p *prebuiltLibraryLinker) skipInstall(mod *Module) {
	mod.ModuleBase.SkipInstall()
}

func NewPrebuiltLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
func NewPrebuiltLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
	module, library := NewLibrary(hod)
	module, library := NewLibrary(hod)
	module.compiler = nil
	module.compiler = nil
@@ -163,6 +167,7 @@ func NewPrebuiltLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDec
		libraryDecorator: library,
		libraryDecorator: library,
	}
	}
	module.linker = prebuilt
	module.linker = prebuilt
	module.installer = prebuilt


	module.AddProperties(&prebuilt.properties)
	module.AddProperties(&prebuilt.properties)