|
1 | 1 | #!/bin/bash
|
2 |
| -# Copyright (c) 2018 Google LLC. |
| 2 | +# Copyright (c) 2025 Google LLC |
3 | 3 | #
|
4 | 4 | # Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | # you may not use this file except in compliance with the License.
|
|
12 | 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 | 13 | # See the License for the specific language governing permissions and
|
14 | 14 | # limitations under the License.
|
15 |
| -# |
16 |
| -# Android Build Script. |
17 | 15 |
|
18 | 16 | # Fail on any error.
|
19 | 17 | set -e
|
20 |
| -# Display commands being run. |
21 |
| -set -x |
22 |
| - |
23 |
| -BUILD_ROOT=$PWD |
24 |
| -SRC=$PWD/github/SPIRV-Tools |
25 |
| - |
26 |
| -# This is required to run any git command in the docker since owner will |
27 |
| -# have changed between the clone environment, and the docker container. |
28 |
| -# Marking the root of the repo as safe for ownership changes. |
29 |
| -git config --global --add safe.directory $SRC |
30 |
| - |
31 |
| -# Get clang-format-5.0.0. |
32 |
| -# Once kokoro upgrades the Ubuntu VMs, we can use 'apt-get install clang-format' |
33 |
| -curl -L http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz -o clang-llvm.tar.xz |
34 |
| -tar xf clang-llvm.tar.xz |
35 |
| -export PATH=$PWD/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin:$PATH |
36 | 18 |
|
37 |
| -cd $SRC |
38 |
| -git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers |
39 |
| -git clone https://github.com/google/googletest external/googletest |
40 |
| -cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd .. |
41 |
| -git clone --depth=1 https://github.com/google/effcee external/effcee |
42 |
| -git clone --depth=1 https://github.com/google/re2 external/re2 |
43 |
| -# The --fail flag causes the command to fail on HTTP error response codes, like 404. |
44 |
| -curl -L --fail https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/clang-format-diff.py -o utils/clang-format-diff.py |
| 19 | +SCRIPT_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )" |
| 20 | +SRC_ROOT="$( cd "${SCRIPT_DIR}/../.." >/dev/null 2>&1 && pwd )" |
| 21 | +TARGET_BRANCH="${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH-main}" |
45 | 22 |
|
46 |
| -echo $(date): Check formatting... |
47 |
| -./utils/check_code_format.sh; |
48 |
| -echo $(date): check completed. |
| 23 | +docker run --rm -i \ |
| 24 | + --volume "${SRC_ROOT}:${SRC_ROOT}" \ |
| 25 | + --workdir "${SRC_ROOT}" \ |
| 26 | + "us-east4-docker.pkg.dev/shaderc-build/radial-docker/ubuntu-24.04-amd64/formatter" \ |
| 27 | + "${SCRIPT_DIR}/build-docker.sh" "${TARGET_BRANCH}" |
0 commit comments