diff options
author | 2019-09-26 20:14:28 -0700 | |
---|---|---|
committer | 2019-09-27 10:28:11 -0700 | |
commit | 651436460a335d7e89efab9d6f3f872a397342db (patch) | |
tree | a5c35de036ea08354ef8482f1dbf579db979dbaf /java/builder.go | |
parent | 2784fda1521e582de84e99a6ee65e8eb6281bb5e (diff) |
Pass filename mappings to C++ and Java extractors.
Android builds by default put artifacts into out/ subdirectory of
the source tree, causing the extractor to record their names as
relative. The indexer considers such files as sources, which is wrong.
Fortunately, the extractor can be fed a set of filename rewriting
rules (see build/tools/vnames.json).
Also, undo previous unsuccessful attempt use to absolute path for the
output directory to distinguish between source code and artifacts.
Bug: 141385476
Test: run the build, inspect compilation units of the kzip file
Change-Id: I89ec3aed8fd14f43ea6e0b226d54f643346f6125
Diffstat (limited to 'java/builder.go')
-rw-r--r-- | java/builder.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/java/builder.go b/java/builder.go index 9e068fa64..0a5c79bfa 100644 --- a/java/builder.go +++ b/java/builder.go @@ -64,6 +64,7 @@ var ( _ = pctx.VariableFunc("kytheCorpus", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCorpusName() }) + _ = pctx.SourcePathVariable("kytheVnames", "build/soong/vnames.json") // Run it with -add-opens=java.base/java.nio=ALL-UNNAMED to avoid JDK9's warning about // "Illegal reflective access by com.google.protobuf.Utf8$UnsafeProcessor ... // to field java.nio.Buffer.address" @@ -74,6 +75,7 @@ var ( `( [ ! -s $srcJarDir/list -a ! -s $out.rsp ] || ` + `KYTHE_ROOT_DIRECTORY=. KYTHE_OUTPUT_FILE=$out ` + `KYTHE_CORPUS=${kytheCorpus} ` + + `KYTHE_VNAMES=${kytheVnames} ` + `${config.SoongJavacWrapper} ${config.JavaCmd} ` + `--add-opens=java.base/java.nio=ALL-UNNAMED ` + `-jar ${config.JavaKytheExtractorJar} ` + @@ -84,6 +86,7 @@ var ( CommandDeps: []string{ "${config.JavaCmd}", "${config.JavaKytheExtractorJar}", + "${kytheVnames}", "${config.ZipSyncCmd}", }, CommandOrderOnly: []string{"${config.SoongJavacWrapper}"}, |