tree: 6402044c708468a8c55953edf53bff0a4aad0d92 [path history] [tgz]
  1. bazel_wrapper.sh
  2. BUILD
  3. Dockerfile
  4. extract.sh
  5. extractors.bazelrc
  6. README.md
kythe/extractors/bazel/README.md

Bazel Kythe extraction

This package contains a Docker image that configures the gcr.io/cloud-builders/bazel Cloud Builder to extract Kythe .kzip compilations from supported targets: gcr.io/kythe-public/bazel-extractor

Supported Bazel rules

  • cc_{library,binary,test} (CppCompile action mnemonic)
  • go_{library,binary,test} (GoCompile action mnemonic)
  • java_{library,binary,test,import,proto_library} (Javac and JavaIjar action mnemonics)
  • proto_library (GenProtoDescriptorSet action mnemonic)
  • rust_{binary,library,test} (Rustc action mnemonic)
  • typescript_library (TypeScriptCompile action mnemonic)
  • ng_module (AngularTemplateCompile action mnemonic)

Building

bazel build -c opt --stamp //kythe/extractors/bazel:docker

Example usage

git clone https://github.com/protocolbuffers/protobuf.git

mkdir -p output
docker run \
  --mount type=bind,source=$PWD/protobuf,target=/workspace/code \
  --mount type=bind,source=$PWD/output,target=/workspace/output \
  -e KYTHE_OUTPUT_DIRECTORY=/workspace/output \
  -w /workspace/code \
  gcr.io/kythe-public/bazel-extractor build \
  --define kythe_corpus=github.com/protocolbuffers/protobuf //...

kzip view output/compilations.kzip