Loading android/config.go +8 −0 Original line number Diff line number Diff line Loading @@ -835,6 +835,14 @@ func (c *config) XrefCorpusName() string { return c.Getenv("XREF_CORPUS") } // Returns Compilation Unit encoding to use. Can be 'json' (default), 'proto' or 'all'. func (c *config) XrefCuEncoding() string { if enc := c.Getenv("KYTHE_KZIP_ENCODING"); enc != "" { return enc } return "json" } func (c *config) EmitXrefRules() bool { return c.XrefCorpusName() != "" } Loading build_kzip.bash +2 −0 Original line number Diff line number Diff line Loading @@ -6,12 +6,14 @@ # The following environment variables affect the result: # BUILD_NUMBER build number, used to generate unique ID (will use UUID if not set) # DIST_DIR where the resulting all.kzip will be placed # KYTHE_KZIP_ENCODING proto or json (proto is default) # OUT_DIR output directory (out if not specified}) # TARGET_BUILD_VARIANT variant, e.g., `userdebug` # TARGET_PRODUCT target device name, e.g., 'aosp_blueline' # XREF_CORPUS source code repository URI, e.g., 'android.googlesource.com/platform/superproject' : ${BUILD_NUMBER:=$(uuidgen)} : ${KYTHE_KZIP_ENCODING:=proto} # The extraction might fail for some source files, so run with -k and then check that # sufficiently many files were generated. Loading cc/builder.go +5 −1 Original line number Diff line number Diff line Loading @@ -238,9 +238,13 @@ var ( _ = pctx.SourcePathVariable("kytheVnames", "build/soong/vnames.json") _ = pctx.VariableFunc("kytheCorpus", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCorpusName() }) _ = pctx.VariableFunc("kytheCuEncoding", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCuEncoding() }) kytheExtract = pctx.StaticRule("kythe", blueprint.RuleParams{ Command: "rm -f $out && KYTHE_CORPUS=${kytheCorpus} KYTHE_OUTPUT_FILE=$out KYTHE_VNAMES=$kytheVnames $cxxExtractor $cFlags $in ", Command: `rm -f $out && ` + `KYTHE_CORPUS=${kytheCorpus} KYTHE_OUTPUT_FILE=$out KYTHE_VNAMES=$kytheVnames KYTHE_KZIP_ENCODING=${kytheCuEncoding} ` + `$cxxExtractor $cFlags $in `, CommandDeps: []string{"$cxxExtractor", "$kytheVnames"}, }, "cFlags") Loading java/builder.go +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ var ( _ = pctx.VariableFunc("kytheCorpus", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCorpusName() }) _ = pctx.VariableFunc("kytheCuEncoding", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCuEncoding() }) _ = 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 ... Loading @@ -76,6 +78,7 @@ var ( `KYTHE_ROOT_DIRECTORY=. KYTHE_OUTPUT_FILE=$out ` + `KYTHE_CORPUS=${kytheCorpus} ` + `KYTHE_VNAMES=${kytheVnames} ` + `KYTHE_KZIP_ENCODING=${kytheCuEncoding} ` + `${config.SoongJavacWrapper} ${config.JavaCmd} ` + `--add-opens=java.base/java.nio=ALL-UNNAMED ` + `-jar ${config.JavaKytheExtractorJar} ` + Loading Loading
android/config.go +8 −0 Original line number Diff line number Diff line Loading @@ -835,6 +835,14 @@ func (c *config) XrefCorpusName() string { return c.Getenv("XREF_CORPUS") } // Returns Compilation Unit encoding to use. Can be 'json' (default), 'proto' or 'all'. func (c *config) XrefCuEncoding() string { if enc := c.Getenv("KYTHE_KZIP_ENCODING"); enc != "" { return enc } return "json" } func (c *config) EmitXrefRules() bool { return c.XrefCorpusName() != "" } Loading
build_kzip.bash +2 −0 Original line number Diff line number Diff line Loading @@ -6,12 +6,14 @@ # The following environment variables affect the result: # BUILD_NUMBER build number, used to generate unique ID (will use UUID if not set) # DIST_DIR where the resulting all.kzip will be placed # KYTHE_KZIP_ENCODING proto or json (proto is default) # OUT_DIR output directory (out if not specified}) # TARGET_BUILD_VARIANT variant, e.g., `userdebug` # TARGET_PRODUCT target device name, e.g., 'aosp_blueline' # XREF_CORPUS source code repository URI, e.g., 'android.googlesource.com/platform/superproject' : ${BUILD_NUMBER:=$(uuidgen)} : ${KYTHE_KZIP_ENCODING:=proto} # The extraction might fail for some source files, so run with -k and then check that # sufficiently many files were generated. Loading
cc/builder.go +5 −1 Original line number Diff line number Diff line Loading @@ -238,9 +238,13 @@ var ( _ = pctx.SourcePathVariable("kytheVnames", "build/soong/vnames.json") _ = pctx.VariableFunc("kytheCorpus", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCorpusName() }) _ = pctx.VariableFunc("kytheCuEncoding", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCuEncoding() }) kytheExtract = pctx.StaticRule("kythe", blueprint.RuleParams{ Command: "rm -f $out && KYTHE_CORPUS=${kytheCorpus} KYTHE_OUTPUT_FILE=$out KYTHE_VNAMES=$kytheVnames $cxxExtractor $cFlags $in ", Command: `rm -f $out && ` + `KYTHE_CORPUS=${kytheCorpus} KYTHE_OUTPUT_FILE=$out KYTHE_VNAMES=$kytheVnames KYTHE_KZIP_ENCODING=${kytheCuEncoding} ` + `$cxxExtractor $cFlags $in `, CommandDeps: []string{"$cxxExtractor", "$kytheVnames"}, }, "cFlags") Loading
java/builder.go +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ var ( _ = pctx.VariableFunc("kytheCorpus", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCorpusName() }) _ = pctx.VariableFunc("kytheCuEncoding", func(ctx android.PackageVarContext) string { return ctx.Config().XrefCuEncoding() }) _ = 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 ... Loading @@ -76,6 +78,7 @@ var ( `KYTHE_ROOT_DIRECTORY=. KYTHE_OUTPUT_FILE=$out ` + `KYTHE_CORPUS=${kytheCorpus} ` + `KYTHE_VNAMES=${kytheVnames} ` + `KYTHE_KZIP_ENCODING=${kytheCuEncoding} ` + `${config.SoongJavacWrapper} ${config.JavaCmd} ` + `--add-opens=java.base/java.nio=ALL-UNNAMED ` + `-jar ${config.JavaKytheExtractorJar} ` + Loading