aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-07-13 14:41:17 -0700
committerColin Cross <ccross@android.com>2017-07-14 08:24:36 -0700
commitd48633a564a24c22371ff5174c5cd646dda56b81 (patch)
tree846485c1f9e04854f1e2226a094b509080946648
parent38cef8ac3979da8e13037540981fe7aecc1e1fbe (diff)
downloadbuild_soong-d48633a564a24c22371ff5174c5cd646dda56b81.tar.gz
build_soong-d48633a564a24c22371ff5174c5cd646dda56b81.tar.bz2
build_soong-d48633a564a24c22371ff5174c5cd646dda56b81.zip
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
-rw-r--r--java/java.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go
index 3cc552f0..adb3d7bd 100644
--- a/java/java.go
+++ b/java/java.go
@@ -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
}