build device binary for java_test_host
This commit adds support for a java_host_test that requires a target binary to run. If the binary has host and target variants and is added as a dependency in the `data` attribute, then the host variant is used. Instead, we need a way to force the use of the target variant. Bug: 182919153 Test: add code from aosp/1647282/1 && atest AuthFsHostTest Change-Id: I68a6259b41a5e6809e1b82eec3122ffdf5067f56
This commit is contained in:
@@ -188,20 +188,20 @@ func AutoGenNativeBenchmarkTestConfig(ctx android.ModuleContext, testConfigProp
|
||||
}
|
||||
|
||||
func AutoGenJavaTestConfig(ctx android.ModuleContext, testConfigProp *string, testConfigTemplateProp *string,
|
||||
testSuites []string, autoGenConfig *bool, unitTest *bool) android.Path {
|
||||
testSuites []string, config []Config, autoGenConfig *bool, unitTest *bool) android.Path {
|
||||
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites, autoGenConfig, testConfigTemplateProp)
|
||||
if autogenPath != nil {
|
||||
templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp)
|
||||
if templatePath.Valid() {
|
||||
autogenTemplate(ctx, autogenPath, templatePath.String(), nil, "")
|
||||
autogenTemplate(ctx, autogenPath, templatePath.String(), config, "")
|
||||
} else {
|
||||
if ctx.Device() {
|
||||
autogenTemplate(ctx, autogenPath, "${JavaTestConfigTemplate}", nil, "")
|
||||
autogenTemplate(ctx, autogenPath, "${JavaTestConfigTemplate}", config, "")
|
||||
} else {
|
||||
if Bool(unitTest) {
|
||||
autogenTemplate(ctx, autogenPath, "${JavaHostUnitTestConfigTemplate}", nil, "")
|
||||
autogenTemplate(ctx, autogenPath, "${JavaHostUnitTestConfigTemplate}", config, "")
|
||||
} else {
|
||||
autogenTemplate(ctx, autogenPath, "${JavaHostTestConfigTemplate}", nil, "")
|
||||
autogenTemplate(ctx, autogenPath, "${JavaHostTestConfigTemplate}", config, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user