summaryrefslogtreecommitdiff
path: root/android/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/config.go')
-rw-r--r--android/config.go50
1 files changed, 32 insertions, 18 deletions
diff --git a/android/config.go b/android/config.go
index 614386f6f..e09173155 100644
--- a/android/config.go
+++ b/android/config.go
@@ -19,6 +19,7 @@ package android
import (
"encoding/json"
+ "errors"
"fmt"
"io/ioutil"
"os"
@@ -68,6 +69,18 @@ func (c Config) BuildDir() string {
return c.buildDir
}
+func (c Config) NinjaBuildDir() string {
+ return c.buildDir
+}
+
+func (c Config) DebugCompilation() bool {
+ return false // Never compile Go code in the main build for debugging
+}
+
+func (c Config) SrcDir() string {
+ return c.srcDir
+}
+
// A DeviceConfig object represents the configuration for a particular device
// being built. For now there will only be one of these, but in the future there
// may be multiple devices being built.
@@ -270,23 +283,6 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
return Config{config}
}
-// TestArchConfigNativeBridge returns a Config object suitable for using
-// for tests that need to run the arch mutator for native bridge supported
-// archs.
-func TestArchConfigNativeBridge(buildDir string, env map[string]string, bp string, fs map[string][]byte) Config {
- testConfig := TestArchConfig(buildDir, env, bp, fs)
- config := testConfig.config
-
- config.Targets[Android] = []Target{
- {Android, Arch{ArchType: X86_64, ArchVariant: "silvermont", Abi: []string{"arm64-v8a"}}, NativeBridgeDisabled, "", "", false},
- {Android, Arch{ArchType: X86, ArchVariant: "silvermont", Abi: []string{"armeabi-v7a"}}, NativeBridgeDisabled, "", "", false},
- {Android, Arch{ArchType: Arm64, ArchVariant: "armv8-a", Abi: []string{"arm64-v8a"}}, NativeBridgeEnabled, "x86_64", "arm64", false},
- {Android, Arch{ArchType: Arm, ArchVariant: "armv7-a-neon", Abi: []string{"armeabi-v7a"}}, NativeBridgeEnabled, "x86", "arm", false},
- }
-
- return testConfig
-}
-
func fuchsiaTargets() map[OsType][]Target {
return map[OsType][]Target{
Fuchsia: {
@@ -498,6 +494,10 @@ func (c *config) SetStopBefore(stopBefore bootstrap.StopBefore) {
c.stopBefore = stopBefore
}
+func (c *config) SetAllowMissingDependencies() {
+ c.productVariables.Allow_missing_dependencies = proptools.BoolPtr(true)
+}
+
var _ bootstrap.ConfigStopBefore = (*config)(nil)
// BlueprintToolLocation returns the directory containing build system tools
@@ -1005,7 +1005,7 @@ func (c *config) DexpreoptGlobalConfig(ctx PathContext) ([]byte, error) {
}
func (c *config) FrameworksBaseDirExists(ctx PathContext) bool {
- return ExistentPathForSource(ctx, "frameworks", "base").Valid()
+ return ExistentPathForSource(ctx, "frameworks", "base", "Android.bp").Valid()
}
func (c *config) VndkSnapshotBuildArtifacts() bool {
@@ -1623,6 +1623,20 @@ func (l *ConfiguredJarList) UnmarshalJSON(b []byte) error {
return nil
}
+func (l *ConfiguredJarList) MarshalJSON() ([]byte, error) {
+ if len(l.apexes) != len(l.jars) {
+ return nil, errors.New(fmt.Sprintf("Inconsistent ConfiguredJarList: apexes: %q, jars: %q", l.apexes, l.jars))
+ }
+
+ list := make([]string, 0, len(l.apexes))
+
+ for i := 0; i < len(l.apexes); i++ {
+ list = append(list, l.apexes[i]+":"+l.jars[i])
+ }
+
+ return json.Marshal(list)
+}
+
// ModuleStem hardcodes the stem of framework-minus-apex to return "framework".
//
// TODO(b/139391334): hard coded until we find a good way to query the stem of a