diff options
Diffstat (limited to 'java/ravenwood.go')
-rw-r--r-- | java/ravenwood.go | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/java/ravenwood.go b/java/ravenwood.go index 84d6a9f41..c4078c587 100644 --- a/java/ravenwood.go +++ b/java/ravenwood.go @@ -185,26 +185,24 @@ func (r *ravenwoodTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { // All JNI libraries included in the runtime var runtimeJniModuleNames map[string]bool - if utils := ctx.GetDirectDepsWithTag(ravenwoodUtilsTag)[0]; utils != nil { - for _, installFile := range android.OtherModuleProviderOrDefault( - ctx, utils, android.InstallFilesProvider).InstallFiles { - installDeps = append(installDeps, installFile) - } - jniDeps, ok := android.OtherModuleProvider(ctx, utils, ravenwoodLibgroupJniDepProvider) - if ok { - runtimeJniModuleNames = jniDeps.names - } + utils := ctx.GetDirectDepsProxyWithTag(ravenwoodUtilsTag)[0] + for _, installFile := range android.OtherModuleProviderOrDefault( + ctx, utils, android.InstallFilesProvider).InstallFiles { + installDeps = append(installDeps, installFile) + } + jniDeps, ok := android.OtherModuleProvider(ctx, utils, ravenwoodLibgroupJniDepProvider) + if ok { + runtimeJniModuleNames = jniDeps.names } - if runtime := ctx.GetDirectDepsWithTag(ravenwoodRuntimeTag)[0]; runtime != nil { - for _, installFile := range android.OtherModuleProviderOrDefault( - ctx, runtime, android.InstallFilesProvider).InstallFiles { - installDeps = append(installDeps, installFile) - } - jniDeps, ok := android.OtherModuleProvider(ctx, runtime, ravenwoodLibgroupJniDepProvider) - if ok { - runtimeJniModuleNames = jniDeps.names - } + runtime := ctx.GetDirectDepsProxyWithTag(ravenwoodRuntimeTag)[0] + for _, installFile := range android.OtherModuleProviderOrDefault( + ctx, runtime, android.InstallFilesProvider).InstallFiles { + installDeps = append(installDeps, installFile) + } + jniDeps, ok = android.OtherModuleProvider(ctx, runtime, ravenwoodLibgroupJniDepProvider) + if ok { + runtimeJniModuleNames = jniDeps.names } // Also remember what JNI libs are in the runtime. @@ -228,7 +226,7 @@ func (r *ravenwoodTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { resApkInstallPath := installPath.Join(ctx, "ravenwood-res-apks") copyResApk := func(tag blueprint.DependencyTag, toFileName string) { - if resApk := ctx.GetDirectDepsWithTag(tag); len(resApk) > 0 { + if resApk := ctx.GetDirectDepsProxyWithTag(tag); len(resApk) > 0 { installFile := android.OutputFileForModule(ctx, resApk[0], "") installResApk := ctx.InstallFile(resApkInstallPath, toFileName, installFile) installDeps = append(installDeps, installResApk) @@ -260,6 +258,19 @@ func (r *ravenwoodTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Install our JAR with all dependencies ctx.InstallFile(installPath, ctx.ModuleName()+".jar", r.outputFile, installDeps...) + + moduleInfoJSON := ctx.ModuleInfoJSON() + if _, ok := r.testConfig.(android.WritablePath); ok { + moduleInfoJSON.AutoTestConfig = []string{"true"} + } + if r.testConfig != nil { + moduleInfoJSON.TestConfig = append(moduleInfoJSON.TestConfig, r.testConfig.String()) + } + moduleInfoJSON.CompatibilitySuites = []string{"general-tests", "ravenwood-tests"} + + android.SetProvider(ctx, android.TestSuiteInfoProvider, android.TestSuiteInfo{ + TestSuites: r.TestSuites(), + }) } func (r *ravenwoodTest) AndroidMkEntries() []android.AndroidMkEntries { @@ -345,7 +356,7 @@ func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContex // Install our runtime into expected location for packaging installPath := android.PathForModuleInstall(ctx, r.BaseModuleName()) for _, lib := range r.ravenwoodLibgroupProperties.Libs { - libModule := ctx.GetDirectDepWithTag(lib, ravenwoodLibContentTag) + libModule := ctx.GetDirectDepProxyWithTag(lib, ravenwoodLibContentTag) if libModule == nil { if ctx.Config().AllowMissingDependencies() { ctx.AddMissingDependencies([]string{lib}) @@ -377,6 +388,10 @@ func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContex // Normal build should perform install steps ctx.Phony(r.BaseModuleName(), android.PathForPhony(ctx, r.BaseModuleName()+"-install")) + + android.SetProvider(ctx, android.TestSuiteInfoProvider, android.TestSuiteInfo{ + TestSuites: r.TestSuites(), + }) } // collectTransitiveJniDeps returns all JNI dependencies, including transitive |