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

Commit 864116ce authored by Paul Duffin's avatar Paul Duffin
Browse files

Add PrebuiltNameFromSource

Bug: 177892522
Test: m nothing
Change-Id: I45274836d59adbd6b2a2a848705b189398f1e766
parent e1d38376
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -82,6 +82,12 @@ func RemoveOptionalPrebuiltPrefix(name string) string {
}

func (p *Prebuilt) Name(name string) string {
	return PrebuiltNameFromSource(name)
}

// PrebuiltNameFromSource returns the result of prepending the "prebuilt_" prefix to the supplied
// name.
func PrebuiltNameFromSource(name string) string {
	return "prebuilt_" + name
}

+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ func prebuiltApexExportedModuleName(ctx android.BottomUpMutatorContext, name str
	// the unprefixed name is the one to use. If the unprefixed one turns out to be a source module
	// and not a renamed prebuilt module then that will be detected and reported as an error when
	// processing the dependency in ApexInfoMutator().
	prebuiltName := "prebuilt_" + name
	prebuiltName := android.PrebuiltNameFromSource(name)
	if ctx.OtherModuleExists(prebuiltName) {
		name = prebuiltName
	}
+2 −2
Original line number Diff line number Diff line
@@ -1945,11 +1945,11 @@ func (module *SdkLibraryImport) ComponentDepsMutator(ctx android.BottomUpMutator
		}

		// Add dependencies to the prebuilt stubs library
		ctx.AddVariationDependencies(nil, apiScope.stubsTag, "prebuilt_"+module.stubsLibraryModuleName(apiScope))
		ctx.AddVariationDependencies(nil, apiScope.stubsTag, android.PrebuiltNameFromSource(module.stubsLibraryModuleName(apiScope)))

		if len(scopeProperties.Stub_srcs) > 0 {
			// Add dependencies to the prebuilt stubs source library
			ctx.AddVariationDependencies(nil, apiScope.stubsSourceTag, "prebuilt_"+module.stubsSourceModuleName(apiScope))
			ctx.AddVariationDependencies(nil, apiScope.stubsSourceTag, android.PrebuiltNameFromSource(module.stubsSourceModuleName(apiScope)))
		}
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ func (system *systemModulesImport) Prebuilt() *android.Prebuilt {
// modules.
func (system *systemModulesImport) ComponentDepsMutator(ctx android.BottomUpMutatorContext) {
	for _, lib := range system.properties.Libs {
		ctx.AddVariationDependencies(nil, systemModulesLibsTag, "prebuilt_"+lib)
		ctx.AddVariationDependencies(nil, systemModulesLibsTag, android.PrebuiltNameFromSource(lib))
	}
}