Browse Source

Introduce product variable Build_from_text_stub

Build_from_text_stub can be used to specify static lib and exclude
static lib based on build configuration.

Bug: 285410821
Test: m
Change-Id: I083f32325c7b3ab5e88c4f5cb248c00f2094fb1e
Jihoon Kang 1 year ago
parent
commit
cbcad7c62f
2 changed files with 10 additions and 0 deletions
  1. 3 0
      android/config.go
  2. 7 0
      android/variable.go

+ 3 - 0
android/config.go

@@ -517,6 +517,8 @@ func NewConfig(cmdArgs CmdArgs, availableEnv map[string]string) (Config, error)
 		config: config,
 	}
 
+	config.productVariables.Build_from_text_stub = boolPtr(config.buildFromTextStub)
+
 	// Soundness check of the build and source directories. This won't catch strange
 	// configurations with symlinks, but at least checks the obvious case.
 	absBuildDir, err := filepath.Abs(cmdArgs.SoongOutDir)
@@ -2017,6 +2019,7 @@ func (c *config) BuildFromTextStub() bool {
 
 func (c *config) SetBuildFromTextStub(b bool) {
 	c.buildFromTextStub = b
+	c.productVariables.Build_from_text_stub = boolPtr(b)
 }
 
 func (c *config) AddForceEnabledModules(forceEnabled []string) {

+ 7 - 0
android/variable.go

@@ -109,6 +109,11 @@ type variableProperties struct {
 			Cflags []string
 		}
 
+		Build_from_text_stub struct {
+			Static_libs         []string
+			Exclude_static_libs []string
+		}
+
 		// debuggable is true for eng and userdebug builds, and can be used to turn on additional
 		// debugging features that don't significantly impact runtime behavior.  userdebug builds
 		// are used for dogfooding and performance testing, and should be as similar to user builds
@@ -286,6 +291,7 @@ type productVariables struct {
 	Uml                          *bool    `json:",omitempty"`
 	Arc                          *bool    `json:",omitempty"`
 	MinimizeJavaDebugInfo        *bool    `json:",omitempty"`
+	Build_from_text_stub         *bool    `json:",omitempty"`
 
 	Check_elf_files *bool `json:",omitempty"`
 
@@ -526,6 +532,7 @@ func (v *productVariables) SetDefaultConfig() {
 		Malloc_pattern_fill_contents: boolPtr(false),
 		Safestack:                    boolPtr(false),
 		TrimmedApex:                  boolPtr(false),
+		Build_from_text_stub:         boolPtr(false),
 
 		BootJars:     ConfiguredJarList{apexes: []string{}, jars: []string{}},
 		ApexBootJars: ConfiguredJarList{apexes: []string{}, jars: []string{}},