diff options
author | Colin Cross <ccross@android.com> | 2017-11-14 13:12:14 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-11-17 11:22:08 -0800 |
commit | ebe1a51c81f9ab300e55126a8a7e3028c64efcd7 (patch) | |
tree | 99dc57ab1e03d45e5319cf4c6e072db853298353 /java/java.go | |
parent | d5dbfb78a0f30f0b3ee43a514e4f59206c203458 (diff) |
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
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/java/java.go b/java/java.go index 432e816e5..8a9b31f75 100644 --- a/java/java.go +++ b/java/java.go @@ -136,12 +136,17 @@ type CompilerDeviceProperties struct { // 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) hasSrcExt(ext string) bool { 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 @@ func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.Opt } 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) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB 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) |