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

Commit 52df388f authored by LaMont Jones's avatar LaMont Jones
Browse files

Minor flagging cleanup

Add an underscore to make the linter more happy.

Bug: 339672075
Bug: 328495189
Test: manual
Change-Id: I6b1d6dcd0aff3c82551021b3f4768a34f27d6fb2
parent c6aef168
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@ import (
)

var (
	// When a flag declaration has an initial value that is a string, the default workflow is WorkflowPrebuilt.
	// If the flag name starts with any of prefixes in manualFlagNamePrefixes, it is WorkflowManual.
	// When a flag declaration has an initial value that is a string, the default workflow is Workflow_Prebuilt.
	// If the flag name starts with any of prefixes in manualFlagNamePrefixes, it is Workflow_Manual.
	manualFlagNamePrefixes []string = []string{
		"RELEASE_ACONFIG_",
		"RELEASE_PLATFORM_",
@@ -133,8 +133,8 @@ func ProcessBuildFlags(dir string, namespaceMap map[string]string) error {
			Containers:  containers,
		}
		description = ""
		// Most build flags are `workflow: WorkflowPrebuilt`.
		workflow := rc_proto.Workflow(rc_proto.Workflow_WorkflowPrebuilt)
		// Most build flags are `workflow: Workflow_Prebuilt`.
		workflow := rc_proto.Workflow(rc_proto.Workflow_Workflow_Prebuilt)
		switch {
		case declName == "RELEASE_ACONFIG_VALUE_SETS":
			if strings.HasPrefix(declValue, "\"") {
@@ -142,21 +142,21 @@ func ProcessBuildFlags(dir string, namespaceMap map[string]string) error {
			}
			continue
		case strings.HasPrefix(declValue, "\""):
			// String values mean that the flag workflow is (most likely) either WorkflowManual or WorkflowPrebuilt.
			// String values mean that the flag workflow is (most likely) either Workflow_Manual or Workflow_Prebuilt.
			declValue = declValue[1 : len(declValue)-1]
			flagDeclaration.Value = &rc_proto.Value{Val: &rc_proto.Value_StringValue{declValue}}
			for _, prefix := range manualFlagNamePrefixes {
				if strings.HasPrefix(declName, prefix) {
					workflow = rc_proto.Workflow(rc_proto.Workflow_WorkflowManual)
					workflow = rc_proto.Workflow(rc_proto.Workflow_Workflow_Manual)
					break
				}
			}
		case declValue == "False" || declValue == "True":
			// Boolean values are WorkflowLaunch flags.
			// Boolean values are Workflow_Launch flags.
			flagDeclaration.Value = &rc_proto.Value{Val: &rc_proto.Value_BoolValue{declValue == "True"}}
			workflow = rc_proto.Workflow(rc_proto.Workflow_WorkflowLaunch)
			workflow = rc_proto.Workflow(rc_proto.Workflow_Workflow_Launch)
		case declValue == "None":
			// Use WorkflowPrebuilt workflow with no initial value.
			// Use Workflow_Prebuilt workflow with no initial value.
		default:
			fmt.Printf("%s: Unexpected value %s=%s\n", path, declName, declValue)
		}
+3 −3
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ func (config *ReleaseConfig) GenerateReleaseConfig(configs *ReleaseConfigs) erro

	contributionsToApply = append(contributionsToApply, config.Contributions...)

	workflowManual := rc_proto.Workflow(rc_proto.Workflow_WorkflowManual)
	workflowManual := rc_proto.Workflow(rc_proto.Workflow_Workflow_Manual)
	myDirsMap := make(map[int]bool)
	for _, contrib := range contributionsToApply {
		contribAconfigValueSets := []string{}
@@ -211,8 +211,8 @@ func (config *ReleaseConfig) GenerateReleaseConfig(configs *ReleaseConfigs) erro
				return fmt.Errorf("Setting value for flag %s not allowed in %s\n", name, value.path)
			}
			if isRoot && *fa.FlagDeclaration.Workflow != workflowManual {
				// The "root" release config can only contain workflow: WorkflowManual flags.
				return fmt.Errorf("Setting value for non-WorkflowManual flag %s is not allowed in %s", name, value.path)
				// The "root" release config can only contain workflow: Workflow_Manual flags.
				return fmt.Errorf("Setting value for non-Workflow_Manual flag %s is not allowed in %s", name, value.path)
			}
			if err := fa.UpdateValue(*value); err != nil {
				return err
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ func ReleaseConfigsFactory() (c *ReleaseConfigs) {
		configDirIndexes:     make(ReleaseConfigDirMap),
		FilesUsedMap:         make(map[string]bool),
	}
	workflowManual := rc_proto.Workflow(rc_proto.Workflow_WorkflowManual)
	workflowManual := rc_proto.Workflow(rc_proto.Workflow_Workflow_Manual)
	releaseAconfigValueSets := FlagArtifact{
		FlagDeclaration: &rc_proto.FlagDeclaration{
			Name:        proto.String("RELEASE_ACONFIG_VALUE_SETS"),
+4 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2024 The Android Open-Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
+4 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2024 The Android Open-Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
Loading