Installing Bazel

See the instructions for installing Bazel on:

For other platforms, you can try to compile from source.

Required Java version:

  • Java JDK 8 or later (JDK 7 is still supported but deprecated).

Extras:

For more information on using Bazel, see Getting Started with Bazel.

Using Bazel with JDK 7 (deprecated)

Bazel version 0.1.0 runs without any change with JDK 7. However, future version will stop supporting JDK 7 when our CI cannot build for it anymore. The installer for JDK 7 for Bazel versions after 0.1.0 is labeled

./bazel-version-jdk7-installer-os.sh
If you wish to use JDK 7, follow the same steps as for JDK 8 but with the jdk7 installer or using a different APT repository as described here.

Getting bash completion

Bazel comes with a bash completion script, which the installer copies into the bin directory. If you ran the installer with --user, this will be $HOME/.bazel/bin. If you ran the installer as root, this will be /usr/local/bazel/bin.

Copy the bazel-complete.bash script to your completion folder (/etc/bash_completion.d directory under Ubuntu). If you don't have a completion folder, you can copy it wherever suits you and insert source /path/to/bazel-complete.bash in your ~/.bashrc file (under OS X, put it in your ~/.bash_profile file).

If you built Bazel from source, the bash completion target is in the //scripts package:

  1. Build it with Bazel: bazel build //scripts:bazel-complete.bash.
  2. Copy the script bazel-bin/scripts/bazel-complete.bash to one of the locations described above.

Getting zsh completion

Bazel also comes with a zsh completion script. To install it:

  1. Add this script to a directory on your $fpath:

    fpath[1,0]=~/.zsh/completion/
    mkdir -p ~/.zsh/completion/
    cp scripts/zsh_completion/_bazel ~/.zsh/completion
    

    You may have to call rm -f ~/.zcompdump; compinit the first time to make it work.

  2. Optionally, add the following to your .zshrc.

    # This way the completion script does not have to parse Bazel's options
    # repeatedly.  The directory in cache-path must be created manually.
    zstyle ':completion:*' use-cache on
    zstyle ':completion:*' cache-path ~/.zsh/cache
    
::...
免责声明:
当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
内容版权归原作者所有;
本人对内容的有效性/合法性不承担任何强制性责任.
若有不妥, 欢迎评注提醒:

或是邮件反馈可也:
askdama[AT]googlegroups.com


订阅 substack 体验古早写作:


点击注册~> 获得 100$ 体验券: DigitalOcean Referral Badge

关注公众号, 持续获得相关各种嗯哼:
zoomquiet


自怼圈/年度番新

DU22.4
关于 ~ DebugUself with DAMA ;-)
粤ICP备18025058号-1
公安备案号: 44049002000656 ...::