Enable androidmk processing in sdk testing am: 8c3fec4c37

Change-Id: Ia9c64cf005906c73e095991a2d114fe75c29e835
This commit is contained in:
Automerger Merge Worker
2020-03-06 13:34:36 +00:00
3 changed files with 19 additions and 1 deletions

View File

@@ -29,7 +29,11 @@ import (
)
func init() {
RegisterSingletonType("androidmk", AndroidMkSingleton)
RegisterAndroidMkBuildComponents(InitRegistrationContext)
}
func RegisterAndroidMkBuildComponents(ctx RegistrationContext) {
ctx.RegisterSingletonType("androidmk", AndroidMkSingleton)
}
// Deprecated: consider using AndroidMkEntriesProvider instead, especially if you're not going to

View File

@@ -410,6 +410,10 @@ func CheckErrorsAgainstExpectations(t *testing.T, errs []error, expectedErrorPat
}
func SetInMakeForTests(config Config) {
config.inMake = true
}
func AndroidMkEntriesForTest(t *testing.T, config Config, bpPath string, mod blueprint.Module) []AndroidMkEntries {
var p AndroidMkEntriesProvider
var ok bool

View File

@@ -69,6 +69,16 @@ func testSdkContext(bp string, fs map[string][]byte) (*android.TestContext, andr
ctx := android.NewTestArchContext()
// Enable androidmk support.
// * Register the singleton
// * Configure that we are inside make
// * Add CommonOS to ensure that androidmk processing works.
android.RegisterAndroidMkBuildComponents(ctx)
android.SetInMakeForTests(config)
config.Targets[android.CommonOS] = []android.Target{
{android.CommonOS, android.Arch{ArchType: android.Common}, android.NativeBridgeDisabled, "", ""},
}
// from android package
android.RegisterPackageBuildComponents(ctx)
ctx.PreArchMutators(android.RegisterVisibilityRuleChecker)