Fix java AIDL properties to match C/C++
The C/C++ aidl properties use:
aidl: {
local_include_dirs: [],
include_dirs: [],
}
But the Android.bp file was expecting:
aidl_include_dirs: [],
export_aidl_include_dirs: [],
Update java AIDL support to match the C support, which is
also what the androidmk conversion tool is creating.
Test: m checkbuild
Change-Id: I3df763d0b203b1b6556798a21b0553e7d35ad7d5
diff --git a/java/java.go b/java/java.go
index 432e816..8a9b31f 100644
--- a/java/java.go
+++ b/java/java.go
@@ -136,12 +136,17 @@
// if not blank, set to the version of the sdk to compile against
Sdk_version *string
- // directories to pass to aidl tool
- Aidl_includes []string
+ Aidl struct {
+ // Top level directories to pass to aidl tool
+ Include_dirs []string
- // directories that should be added as include directories
- // for any aidl sources of modules that depend on this module
- Export_aidl_include_dirs []string
+ // Directories rooted at the Android.bp file to pass to aidl tool
+ Local_include_dirs []string
+
+ // directories that should be added as include directories for any aidl sources of modules
+ // that depend on this module, as well as to aidl for this module.
+ Export_include_dirs []string
+ }
// If true, export a copy of the module as a -hostdex module for host testing.
Hostdex *bool
@@ -377,7 +382,11 @@
func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.OptionalPath,
aidlIncludeDirs android.Paths) []string {
- localAidlIncludes := android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl_includes)
+ aidlIncludes := android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Local_include_dirs)
+ aidlIncludes = append(aidlIncludes,
+ android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Export_include_dirs)...)
+ aidlIncludes = append(aidlIncludes,
+ android.PathsForSource(ctx, j.deviceProperties.Aidl.Include_dirs)...)
var flags []string
if aidlPreprocess.Valid() {
@@ -387,7 +396,7 @@
}
flags = append(flags, android.JoinWithPrefix(j.exportAidlIncludeDirs.Strings(), "-I"))
- flags = append(flags, android.JoinWithPrefix(localAidlIncludes.Strings(), "-I"))
+ flags = append(flags, android.JoinWithPrefix(aidlIncludes.Strings(), "-I"))
flags = append(flags, "-I"+android.PathForModuleSrc(ctx).String())
if src := android.ExistentPathForSource(ctx, "", ctx.ModuleDir(), "src"); src.Valid() {
flags = append(flags, "-I"+src.String())
@@ -528,7 +537,7 @@
func (j *Module) compile(ctx android.ModuleContext) {
- j.exportAidlIncludeDirs = android.PathsForModuleSrc(ctx, j.deviceProperties.Export_aidl_include_dirs)
+ j.exportAidlIncludeDirs = android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Export_include_dirs)
deps := j.collectDeps(ctx)
flags := j.collectBuilderFlags(ctx, deps)