Use ExistentPathForSource

Converting java to use Path objects incorrectly used PathForModuleSrc
for a path that might not exist, use ExistentPathForSource instead.

Test: java_test.go
Change-Id: I50e4e315a10ab08c4e72065094ae29844874f5e4
This commit is contained in:
Colin Cross 2017-07-13 14:41:17 -07:00
parent 38cef8ac39
commit d48633a564
1 changed files with 3 additions and 1 deletions

View File

@ -203,7 +203,9 @@ 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, "-I"+android.PathForModuleSrc(ctx).String())
flags = append(flags, "-I"+android.PathForModuleSrc(ctx, "src").String())
if src := android.ExistentPathForSource(ctx, "", "src"); src.Valid() {
flags = append(flags, "-I"+src.String())
}
return flags
}