是否可以使用bazel query
获取所有可用的远程存储库(e.x. @com_google_protobuf)的列表?
答案 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
。