您如何查询WORKSPACE中可用的所有存储库的列表?

时间:2017-09-15 00:07:12

标签: bazel

是否可以使用bazel query获取所有可用的远程存储库(e.x. @com_google_protobuf)的列表?

1 个答案:

答案 0 :(得分:4)

我不知道如何获得这一点,但是通过查询合成//external包可以获得过高的效果。它包含每个外部存储库的一个目标。但是,它默认包含一些其他目标。

示例:

$ cat WORKSPACE
local_repository(name = "a", path = "a")
maven_jar(name = "b", artifact = "com.google.guava:guava:19.0")

$ bazel query //external:all
//external:local_jdk
//external:local_config_xcode
//external:local_config_cc
//external:jre-default
//external:jre
//external:jni_md_header-linux
//external:jni_md_header-freebsd
//external:jni_md_header-darwin
//external:jni_header
//external:jdk-default
//external:jdk
//external:javac
//external:java
//external:jar
//external:has_androidsdk
//external:extdir
//external:extclasspath
//external:cc_toolchain
//external:bootclasspath
//external:bazel_tools
//external:bazel_j2objc
//external:b
//external:android_sdk_for_testing
//external:android_ndk_for_testing
//external:android/sdk
//external:android/dx_jar_import
//external:android/crosstool
//external:a

请注意,结果中会显示//external:a//external:b