kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/extractors/bazel/README.md (about)

     1  # Bazel Kythe extraction
     2  
     3  This package contains a Docker image that configures the `gcr.io/cloud-builders/bazel` Cloud Builder
     4  to extract Kythe `.kzip` compilations from supported targets: `gcr.io/kythe-public/bazel-extractor`
     5  
     6  ## Supported Bazel rules
     7  
     8  * cc_{library,binary,test} (`CppCompile` action mnemonic)
     9  * go_{library,binary,test} (`GoCompile` action mnemonic)
    10  * java_{library,binary,test,import,proto_library} (`Javac` and `JavaIjar` action mnemonics)
    11  * proto_library (`GenProtoDescriptorSet` action mnemonic)
    12  * typescript_library (`TypeScriptCompile` action mnemonic)
    13  * ng_module (`AngularTemplateCompile` action mnemonic)
    14  
    15  ## Building
    16  
    17  ```shell
    18  bazel build -c opt --stamp //kythe/extractors/bazel:docker
    19  ```
    20  
    21  ## Example usage
    22  
    23  ```shell
    24  git clone https://github.com/protocolbuffers/protobuf.git
    25  
    26  mkdir -p output
    27  docker run \
    28    --mount type=bind,source=$PWD/protobuf,target=/workspace/code \
    29    --mount type=bind,source=$PWD/output,target=/workspace/output \
    30    -e KYTHE_OUTPUT_DIRECTORY=/workspace/output \
    31    -w /workspace/code \
    32    gcr.io/kythe-public/bazel-extractor build \
    33    --define kythe_corpus=github.com/protocolbuffers/protobuf //...
    34  
    35  kzip view output/compilations.kzip
    36  ```