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

Commit 4bc45d87 authored by Cole Faust's avatar Cole Faust
Browse files

Make platform_bootclasspath a regular module

It was only a singleton module in order to implement
SingletonMakeVarsProvider, but the one make var it exported is no longer
used.

Bug: 361816274
Test: m nothing --no-skip-soong-tests
Change-Id: I5fa627fa60a30de288c59b5e0342e1c606c7ad49
parent bd44fd7e
Loading
Loading
Loading
Loading
+3 −25
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ func init() {
}

func registerPlatformBootclasspathBuildComponents(ctx android.RegistrationContext) {
	ctx.RegisterParallelSingletonModuleType("platform_bootclasspath", platformBootclasspathFactory)
	ctx.RegisterModuleType("platform_bootclasspath", platformBootclasspathFactory)
}

// The tags used for the dependencies between the platform bootclasspath and any configured boot
@@ -37,7 +37,7 @@ var (
)

type platformBootclasspathModule struct {
	android.SingletonModuleBase
	android.ModuleBase
	ClasspathFragmentBase

	properties platformBootclasspathProperties
@@ -64,7 +64,7 @@ type platformBootclasspathProperties struct {
	HiddenAPIFlagFileProperties
}

func platformBootclasspathFactory() android.SingletonModule {
func platformBootclasspathFactory() android.Module {
	m := &platformBootclasspathModule{}
	m.AddProperties(&m.properties)
	initClasspathFragment(m, BOOTCLASSPATH)
@@ -156,18 +156,6 @@ func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, mod
	}
}

// GenerateSingletonBuildActions does nothing and must never do anything.
//
// This module only implements android.SingletonModule so that it can implement
// android.SingletonMakeVarsProvider.
func (b *platformBootclasspathModule) GenerateSingletonBuildActions(android.SingletonContext) {
	// Keep empty
}

func (d *platformBootclasspathModule) MakeVars(ctx android.MakeVarsContext) {
	d.generateHiddenApiMakeVars(ctx)
}

func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
	// Gather all the dependencies from the art, platform, and apex boot jars.
	artModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathArtBootJarDepTag)
@@ -428,13 +416,3 @@ func (b *platformBootclasspathModule) buildRuleMergeCSV(ctx android.ModuleContex

	rule.Build(desc, desc)
}

// generateHiddenApiMakeVars generates make variables needed by hidden API related make rules, e.g.
// veridex and run-appcompat.
func (b *platformBootclasspathModule) generateHiddenApiMakeVars(ctx android.MakeVarsContext) {
	if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
		return
	}
	// INTERNAL_PLATFORM_HIDDENAPI_FLAGS is used by Make rules in art/ and cts/.
	ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_FLAGS", b.hiddenAPIFlagsCSV.String())
}