Ryan Harrison | da8223d | 2019-06-19 15:04:09 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Copyright 2019 The Dawn Authors |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
Ryan Harrison | a84ab48 | 2020-06-17 23:52:19 +0000 | [diff] [blame] | 17 | # Attempts to roll all entries in DEPS to tip-of-tree and create a commit. |
Ryan Harrison | da8223d | 2019-06-19 15:04:09 +0000 | [diff] [blame] | 18 | # |
| 19 | # Depends on roll-dep from depot_path being in PATH. |
| 20 | |
Ryan Harrison | a84ab48 | 2020-06-17 23:52:19 +0000 | [diff] [blame] | 21 | spirv_cross_dir="third_party/spirv-cross/" |
| 22 | spirv_cross_trunk="origin/master" |
| 23 | spirv_headers_dir="third_party/spirv-headers/" |
| 24 | spirv_headers_trunk="origin/master" |
Ryan Harrison | 92554d7 | 2020-07-06 21:31:00 +0000 | [diff] [blame] | 25 | spirv_tools_dir="third_party/SPIRV-Tools/" |
Ryan Harrison | a84ab48 | 2020-06-17 23:52:19 +0000 | [diff] [blame] | 26 | spirv_tools_trunk="origin/master" |
| 27 | tint_dir="third_party/tint/" |
| 28 | tint_trunk="origin/main" |
| 29 | |
Ryan Harrison | da8223d | 2019-06-19 15:04:09 +0000 | [diff] [blame] | 30 | # This script assumes it's parent directory is the repo root. |
| 31 | repo_path=$(dirname "$0")/.. |
| 32 | |
Ryan Harrison | da8223d | 2019-06-19 15:04:09 +0000 | [diff] [blame] | 33 | cd "$repo_path" |
| 34 | |
Ryan Harrison | a84ab48 | 2020-06-17 23:52:19 +0000 | [diff] [blame] | 35 | if [[ $(git diff --stat) != '' ]]; then |
| 36 | echo "Working tree is dirty, commit changes before attempting to roll DEPS" |
| 37 | exit 1 |
| 38 | fi |
| 39 | |
| 40 | old_head=$(git rev-parse HEAD) |
| 41 | |
Ryan Harrison | a84ab48 | 2020-06-17 23:52:19 +0000 | [diff] [blame] | 42 | roll-dep --ignore-dirty-tree --roll-to="${spirv_cross_trunk}" "${spirv_cross_dir}" |
| 43 | roll-dep --ignore-dirty-tree --roll-to="${spirv_headers_trunk}" "${spirv_headers_dir}" |
| 44 | roll-dep --ignore-dirty-tree --roll-to="${spirv_tools_trunk}" "${spirv_tools_dir}" |
| 45 | roll-dep --ignore-dirty-tree --roll-to="${tint_trunk}" "${tint_dir}" |
| 46 | |
| 47 | git rebase --interactive "${old_head}" |