install_format_tools.sh 669 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. # Copyright The OpenTelemetry Authors
  3. # SPDX-License-Identifier: Apache-2.0
  4. set -e
  5. CLANG_VERSION=18
  6. CMAKE_FORMAT_VERSION=0.6.13
  7. BUILDIFIER_VERSION=3.5.0
  8. #
  9. # This script expects ubuntu:24.04
  10. #
  11. apt update
  12. # Install clang-format
  13. apt install -y clang-format-${CLANG_VERSION} python3 python3-pip git curl
  14. # ln /usr/bin/clang-format-${CLANG_VERSION} /usr/bin/clang-format
  15. # Install cmake_format
  16. pip3 install --break-system-packages cmake_format==${CMAKE_FORMAT_VERSION}
  17. # Install buildifier
  18. curl -L -o /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${BUILDIFIER_VERSION}/buildifier
  19. chmod +x /usr/local/bin/buildifier