blob: ac6db480ac07c84df262eed2f2cac4e8b619027a [file] [log] [blame]
Ryan Harrisonda8223d2019-06-19 15:04:09 +00001#!/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 Harrisona84ab482020-06-17 23:52:19 +000017# Attempts to roll all entries in DEPS to tip-of-tree and create a commit.
Ryan Harrisonda8223d2019-06-19 15:04:09 +000018#
19# Depends on roll-dep from depot_path being in PATH.
20
Ryan Harrisona84ab482020-06-17 23:52:19 +000021glslang_dir="third_party/glslang/"
22glslang_trunk="origin/master"
23shaderc_dir="third_party/shaderc/"
24shaderc_trunk="origin/main"
25spirv_cross_dir="third_party/spirv-cross/"
26spirv_cross_trunk="origin/master"
27spirv_headers_dir="third_party/spirv-headers/"
28spirv_headers_trunk="origin/master"
29spirv_tools_dir="third_party/spirv-tools/"
30spirv_tools_trunk="origin/master"
31tint_dir="third_party/tint/"
32tint_trunk="origin/main"
33
Ryan Harrisonda8223d2019-06-19 15:04:09 +000034# This script assumes it's parent directory is the repo root.
35repo_path=$(dirname "$0")/..
36
Ryan Harrisonda8223d2019-06-19 15:04:09 +000037cd "$repo_path"
38
Ryan Harrisona84ab482020-06-17 23:52:19 +000039if [[ $(git diff --stat) != '' ]]; then
40 echo "Working tree is dirty, commit changes before attempting to roll DEPS"
41 exit 1
42fi
43
44old_head=$(git rev-parse HEAD)
45
46roll-dep --ignore-dirty-tree --roll-to="${glslang_trunk}" "${glslang_dir}"
47roll-dep --ignore-dirty-tree --roll-to="${shaderc_trunk}" "${shaderc_dir}"
48roll-dep --ignore-dirty-tree --roll-to="${spirv_cross_trunk}" "${spirv_cross_dir}"
49roll-dep --ignore-dirty-tree --roll-to="${spirv_headers_trunk}" "${spirv_headers_dir}"
50roll-dep --ignore-dirty-tree --roll-to="${spirv_tools_trunk}" "${spirv_tools_dir}"
51roll-dep --ignore-dirty-tree --roll-to="${tint_trunk}" "${tint_dir}"
52
53git rebase --interactive "${old_head}"