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

Commit 3f01580c authored by Cole Faust's avatar Cole Faust Committed by Gerrit Code Review
Browse files

Merge "Make the enabled property configurable" into main

parents 0d4a9ca7 a963b94c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ bootstrap_go_package {
        "buildinfo_prop.go",
        "config.go",
        "test_config.go",
        "configurable_properties.go",
        "configured_jars.go",
        "csuite_config.go",
        "deapexer.go",
+6 −6
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, moduleInfoJSONs *
	mod blueprint.Module, provider AndroidMkDataProvider) error {

	amod := mod.(Module).base()
	if shouldSkipAndroidMkProcessing(amod) {
	if shouldSkipAndroidMkProcessing(ctx, amod) {
		return nil
	}

@@ -945,7 +945,7 @@ func WriteAndroidMkData(w io.Writer, data AndroidMkData) {

func translateAndroidMkEntriesModule(ctx SingletonContext, w io.Writer, moduleInfoJSONs *[]*ModuleInfoJSON,
	mod blueprint.Module, provider AndroidMkEntriesProvider) error {
	if shouldSkipAndroidMkProcessing(mod.(Module).base()) {
	if shouldSkipAndroidMkProcessing(ctx, mod.(Module).base()) {
		return nil
	}

@@ -967,11 +967,11 @@ func translateAndroidMkEntriesModule(ctx SingletonContext, w io.Writer, moduleIn
	return nil
}

func ShouldSkipAndroidMkProcessing(module Module) bool {
	return shouldSkipAndroidMkProcessing(module.base())
func ShouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, module Module) bool {
	return shouldSkipAndroidMkProcessing(ctx, module.base())
}

func shouldSkipAndroidMkProcessing(module *ModuleBase) bool {
func shouldSkipAndroidMkProcessing(ctx ConfigAndErrorContext, module *ModuleBase) bool {
	if !module.commonProperties.NamespaceExportedToMake {
		// TODO(jeffrygaston) do we want to validate that there are no modules being
		// exported to Kati that depend on this module?
@@ -990,7 +990,7 @@ func shouldSkipAndroidMkProcessing(module *ModuleBase) bool {
		return true
	}

	return !module.Enabled() ||
	return !module.Enabled(ctx) ||
		module.commonProperties.HideFromMake ||
		// Make does not understand LinuxBionic
		module.Os() == LinuxBionic ||
+2 −2
Original line number Diff line number Diff line
@@ -486,7 +486,7 @@ func osMutator(bpctx blueprint.BottomUpMutatorContext) {
			// dependencies on OsType variants that are explicitly disabled in their
			// properties. The CommonOS variant will still depend on disabled variants
			// if they are disabled afterwards, e.g. in archMutator if
			if module.Enabled() {
			if module.Enabled(mctx) {
				mctx.AddInterVariantDependency(commonOsToOsSpecificVariantTag, commonOSVariant, module)
			}
		}
@@ -511,7 +511,7 @@ func GetOsSpecificVariantsOfCommonOSVariant(mctx BaseModuleContext) []Module {
	var variants []Module
	mctx.VisitDirectDeps(func(m Module) {
		if mctx.OtherModuleDependencyTag(m) == commonOsToOsSpecificVariantTag {
			if m.Enabled() {
			if m.Enabled(mctx) {
				variants = append(variants, m)
			}
		}
+2 −2
Original line number Diff line number Diff line
@@ -423,7 +423,7 @@ func TestArchMutator(t *testing.T) {
		variants := ctx.ModuleVariantsForTests(name)
		for _, variant := range variants {
			m := ctx.ModuleForTests(name, variant)
			if m.Module().Enabled() {
			if m.Module().Enabled(PanickingConfigAndErrorContext(ctx)) {
				ret = append(ret, variant)
			}
		}
@@ -533,7 +533,7 @@ func TestArchMutatorNativeBridge(t *testing.T) {
		variants := ctx.ModuleVariantsForTests(name)
		for _, variant := range variants {
			m := ctx.ModuleForTests(name, variant)
			if m.Module().Enabled() {
			if m.Module().Enabled(PanickingConfigAndErrorContext(ctx)) {
				ret = append(ret, variant)
			}
		}
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, tag b
		return nil
	}

	if !aModule.Enabled() {
	if !aModule.Enabled(b) {
		if t, ok := tag.(AllowDisabledModuleDependency); !ok || !t.AllowDisabledModuleDependency(aModule) {
			if b.Config().AllowMissingDependencies() {
				b.AddMissingDependencies([]string{b.OtherModuleName(aModule)})
Loading