|
@@ -820,7 +820,7 @@ func (j *Module) individualAidlFlags(ctx android.ModuleContext, aidlFile android
|
|
|
}
|
|
|
|
|
|
func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.OptionalPath,
|
|
|
- aidlIncludeDirs android.Paths) (string, android.Paths) {
|
|
|
+ aidlIncludeDirs android.Paths, aidlSrcs android.Paths) (string, android.Paths) {
|
|
|
|
|
|
aidlIncludes := android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Local_include_dirs)
|
|
|
aidlIncludes = append(aidlIncludes,
|
|
@@ -830,6 +830,7 @@ func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.Opt
|
|
|
|
|
|
var flags []string
|
|
|
var deps android.Paths
|
|
|
+ var includeDirs android.Paths
|
|
|
|
|
|
flags = append(flags, j.deviceProperties.Aidl.Flags...)
|
|
|
|
|
@@ -837,21 +838,24 @@ func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.Opt
|
|
|
flags = append(flags, "-p"+aidlPreprocess.String())
|
|
|
deps = append(deps, aidlPreprocess.Path())
|
|
|
} else if len(aidlIncludeDirs) > 0 {
|
|
|
- flags = append(flags, android.JoinWithPrefix(aidlIncludeDirs.Strings(), "-I"))
|
|
|
+ includeDirs = append(includeDirs, aidlIncludeDirs...)
|
|
|
}
|
|
|
|
|
|
if len(j.exportAidlIncludeDirs) > 0 {
|
|
|
- flags = append(flags, android.JoinWithPrefix(j.exportAidlIncludeDirs.Strings(), "-I"))
|
|
|
+ includeDirs = append(includeDirs, j.exportAidlIncludeDirs...)
|
|
|
}
|
|
|
|
|
|
if len(aidlIncludes) > 0 {
|
|
|
- flags = append(flags, android.JoinWithPrefix(aidlIncludes.Strings(), "-I"))
|
|
|
+ includeDirs = append(includeDirs, aidlIncludes...)
|
|
|
}
|
|
|
|
|
|
- flags = append(flags, "-I"+android.PathForModuleSrc(ctx).String())
|
|
|
+ includeDirs = append(includeDirs, android.PathForModuleSrc(ctx))
|
|
|
if src := android.ExistentPathForSource(ctx, ctx.ModuleDir(), "src"); src.Valid() {
|
|
|
- flags = append(flags, "-I"+src.String())
|
|
|
+ includeDirs = append(includeDirs, src.Path())
|
|
|
}
|
|
|
+ flags = append(flags, android.JoinWithPrefix(includeDirs.Strings(), "-I"))
|
|
|
+ // add flags for dirs containing AIDL srcs that haven't been specified yet
|
|
|
+ flags = append(flags, genAidlIncludeFlags(ctx, aidlSrcs, includeDirs))
|
|
|
|
|
|
if Bool(j.deviceProperties.Aidl.Generate_traces) {
|
|
|
flags = append(flags, "-t")
|
|
@@ -935,9 +939,6 @@ func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB
|
|
|
// systemModules
|
|
|
flags.systemModules = deps.systemModules
|
|
|
|
|
|
- // aidl flags.
|
|
|
- flags.aidlFlags, flags.aidlDeps = j.aidlFlags(ctx, deps.aidlPreprocess, deps.aidlIncludeDirs)
|
|
|
-
|
|
|
return flags
|
|
|
}
|
|
|
|
|
@@ -1046,6 +1047,9 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
|
|
ctx.PropertyErrorf("common_srcs", "common_srcs must be .kt files")
|
|
|
}
|
|
|
|
|
|
+ aidlSrcs := srcFiles.FilterByExt(".aidl")
|
|
|
+ flags.aidlFlags, flags.aidlDeps = j.aidlFlags(ctx, deps.aidlPreprocess, deps.aidlIncludeDirs, aidlSrcs)
|
|
|
+
|
|
|
nonGeneratedSrcJars := srcFiles.FilterByExt(".srcjar")
|
|
|
srcFiles = j.genSources(ctx, srcFiles, flags)
|
|
|
|