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
This commit is contained in:
25
java/java.go
25
java/java.go
@@ -136,12 +136,17 @@ type CompilerDeviceProperties struct {
|
|||||||
// if not blank, set to the version of the sdk to compile against
|
// if not blank, set to the version of the sdk to compile against
|
||||||
Sdk_version *string
|
Sdk_version *string
|
||||||
|
|
||||||
// directories to pass to aidl tool
|
Aidl struct {
|
||||||
Aidl_includes []string
|
// Top level directories to pass to aidl tool
|
||||||
|
Include_dirs []string
|
||||||
|
|
||||||
// directories that should be added as include directories
|
// Directories rooted at the Android.bp file to pass to aidl tool
|
||||||
// for any aidl sources of modules that depend on this module
|
Local_include_dirs []string
|
||||||
Export_aidl_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.
|
// If true, export a copy of the module as a -hostdex module for host testing.
|
||||||
Hostdex *bool
|
Hostdex *bool
|
||||||
@@ -377,7 +382,11 @@ func (j *Module) hasSrcExt(ext string) bool {
|
|||||||
func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.OptionalPath,
|
func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.OptionalPath,
|
||||||
aidlIncludeDirs android.Paths) []string {
|
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
|
var flags []string
|
||||||
if aidlPreprocess.Valid() {
|
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(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())
|
flags = append(flags, "-I"+android.PathForModuleSrc(ctx).String())
|
||||||
if src := android.ExistentPathForSource(ctx, "", ctx.ModuleDir(), "src"); src.Valid() {
|
if src := android.ExistentPathForSource(ctx, "", ctx.ModuleDir(), "src"); src.Valid() {
|
||||||
flags = append(flags, "-I"+src.String())
|
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) {
|
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)
|
deps := j.collectDeps(ctx)
|
||||||
flags := j.collectBuilderFlags(ctx, deps)
|
flags := j.collectBuilderFlags(ctx, deps)
|
||||||
|
Reference in New Issue
Block a user