Lines Matching refs:config
35 const configFileName = "soong.config"
39 // config file. These will be included in the config struct.
50 // A Config object represents the entire build configuration for Android.
51 type Config struct {
52 *config
62 type config struct {
87 config *config
96 func loadConfig(config *config) error {
97 err := loadFromConfigFile(&config.FileConfigurableOptions, config.ConfigFileName)
102 return loadFromConfigFile(&config.ProductVariables, config.ProductVariablesFileName)
125 return fmt.Errorf("config file: %s did not parse correctly: "+err.Error(), filename)
133 // atomically writes the config file in case two copies of soong_build are running simultaneously
135 func saveToConfigFile(config jsonConfigurable, filename string) error {
136 data, err := json.MarshalIndent(&config, "", " ")
138 return fmt.Errorf("cannot marshal config data: %s", err.Error())
141 f, err := ioutil.TempFile(filepath.Dir(filename), "config")
143 return fmt.Errorf("cannot create empty config file %s: %s\n", filename, err.Error())
150 return fmt.Errorf("default config file: %s could not be written: %s", filename, err.Error())
155 return fmt.Errorf("default config file: %s could not be written: %s", filename, err.Error())
164 // TestConfig returns a Config object suitable for using for tests
165 func TestConfig(buildDir string) Config {
166 return Config{&config{
171 // New creates a new Config object. The srcDir argument specifies the path to
172 // the root source directory. It also loads the config file, if found.
173 func NewConfig(srcDir, buildDir string) (Config, error) {
174 // Make a config with default options
175 config := &config{
186 config: config,
189 config.deviceConfig = deviceConfig
195 return Config{}, err
200 return Config{}, err
204 return Config{}, fmt.Errorf("Build dir must not contain source directory")
208 err = loadConfig(config)
210 return Config{}, err
215 config.inMake = true
218 targets, err := decodeTargetProductVariables(config)
220 return Config{}, err
224 if Bool(config.Mega_device) {
226 } else if Bool(config.Ndk_abis) {
233 return Config{}, err
238 config.Targets = targets
239 config.BuildOsVariant = targets[Host][0].String()
241 return Config{config}, nil
244 func (c *config) RemoveAbandonedFiles() bool {
248 func (c *config) BlueprintToolLocation() string {
253 func (c *config) PrebuiltOS() string {
265 func (c *config) GoRoot() string {
269 func (c *config) CpPreserveSymlinksFlags() string {
280 func (c *config) Getenv(key string) string {
298 func (c *config) GetenvWithDefault(key string, defaultValue string) string {
306 func (c *config) IsEnvTrue(key string) bool {
311 func (c *config) IsEnvFalse(key string) bool {
316 func (c *config) EnvDeps() map[string]string {
323 func (c *config) EmbeddedInMake() bool {
329 func (c *config) DeviceName() string {
333 func (c *config) DeviceUsesClang() bool {
340 func (c *config) ResourceOverlays() []SourcePath {
344 func (c *config) PlatformVersion() string {
348 func (c *config) PlatformSdkVersionInt() int {
352 func (c *config) PlatformSdkVersion() string {
356 func (c *config) BuildNumber() string {
360 func (c *config) ProductAaptConfig() []string {
364 func (c *config) ProductAaptPreferredConfig() string {
368 func (c *config) ProductAaptCharacteristics() string {
372 func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath {
376 func (c *config) DefaultAppCertificate(ctx PathContext) SourcePath {
380 func (c *config) AllowMissingDependencies() bool {
384 func (c *config) DevicePrefer32BitExecutables() bool {
388 func (c *config) SkipDeviceInstall() bool {
392 func (c *config) SanitizeHost() []string {
396 func (c *config) SanitizeDevice() []string {
400 func (c *config) SanitizeDeviceArch() []string {
404 func (c *config) EnableCFI() bool {
408 func (c *config) Android64() bool {
418 func (c *config) UseGoma() bool {
422 func (c *config) ClangTidy() bool {
426 func (c *config) TidyChecks() string {
433 func (c *config) LibartImgHostBaseAddress() string {
437 func (c *config) LibartImgDeviceBaseAddress() string {
446 func (c *config) ArtUseReadBarrier() bool {
452 for _, target := range c.config.Targets[Device] {
459 if c.config.ProductVariables.VendorPath != nil {
460 return *c.config.ProductVariables.VendorPath
466 if c.config.ProductVariables.DeviceVndkVersion == nil {
469 return *c.config.ProductVariables.DeviceVndkVersion == "current"
473 return String(c.config.ProductVariables.BtConfigIncludeDir)
477 return Bool(c.config.ProductVariables.NativeCoverage)
482 if c.config.ProductVariables.CoveragePaths != nil {
483 for _, prefix := range *c.config.ProductVariables.CoveragePaths {
490 if coverage && c.config.ProductVariables.CoverageExcludePaths != nil {
491 for _, prefix := range *c.config.ProductVariables.CoverageExcludePaths {