aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-12-06 18:51:25 -0800
committerGravatar Muxi Yan <mxyan@google.com>2017-12-06 18:51:25 -0800
commitf5eb1cf9f0e832a2a6d301cc7adeec22e79ef903 (patch)
tree9b663d50cca9fbf0b90988d479f45ba85abacb0a /tools
parent4a117f0be7feb1779bd0bb0b65c6e2d930f07e80 (diff)
partial cherry-pick of 'update clang-format to 5.0'
Diffstat (limited to 'tools')
-rw-r--r--tools/dockerfile/grpc_clang_format/Dockerfile10
-rwxr-xr-xtools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh4
-rw-r--r--tools/dockerfile/test/sanity/Dockerfile10
3 files changed, 12 insertions, 12 deletions
diff --git a/tools/dockerfile/grpc_clang_format/Dockerfile b/tools/dockerfile/grpc_clang_format/Dockerfile
index dff07feeb6..b3abaef465 100644
--- a/tools/dockerfile/grpc_clang_format/Dockerfile
+++ b/tools/dockerfile/grpc_clang_format/Dockerfile
@@ -14,11 +14,11 @@
FROM debian:jessie
-RUN apt-get update && apt-get -y install wget
-RUN echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN echo "deb-src http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
-RUN apt-get update && apt-get -y install clang-format-3.8
+RUN apt-get update && apt-get -y install wget xz-utils
+RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format
+ENV CLANG_FORMAT=clang-format
ADD clang_format_all_the_things.sh /
CMD ["echo 'Run with tools/distrib/clang_format_code.sh'"]
diff --git a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
index 9bbb5d4dc1..d36e9e57ea 100755
--- a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
+++ b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
@@ -22,14 +22,14 @@ DIRS="src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include
GLOB="*.h *.c *.cc"
# clang format command
-CLANG_FORMAT=clang-format-3.8
+CLANG_FORMAT=${CLANG_FORMAT:-clang-format-5.0}
files=
for dir in $DIRS
do
for glob in $GLOB
do
- files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name *.generated.* -and -not -name *.pb.h -and -not -name *.pb.c -and -not -name *.pb.cc -and -not -name end2end_tests.c -and -not -name end2end_nosec_tests.c -and -not -name public_headers_must_be_c89.c`"
+ files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name '*.generated.*' -and -not -name '*.pb.h' -and -not -name '*.pb.c' -and -not -name '*.pb.cc' -and -not -name end2end_tests.c -and -not -name end2end_nosec_tests.c -and -not -name public_headers_must_be_c89.c`"
done
done
diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile
index 487ce15e2e..da663d5686 100644
--- a/tools/dockerfile/test/sanity/Dockerfile
+++ b/tools/dockerfile/test/sanity/Dockerfile
@@ -100,11 +100,11 @@ RUN curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/0.4.4/ba
RUN chmod +x ./bazel-0.4.4-installer-linux-x86_64.sh
RUN ./bazel-0.4.4-installer-linux-x86_64.sh
-RUN apt-get update && apt-get -y install wget
-RUN echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN echo "deb-src http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
-RUN apt-get update && apt-get -y install clang-format-3.8
+RUN apt-get update && apt-get -y install wget xz-utils
+RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format
+ENV CLANG_FORMAT=clang-format
# Prepare ccache
RUN ln -s /usr/bin/ccache /usr/local/bin/gcc