1#!/usr/bin/env bash 2# Copyright 2020 The Amber Authors 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16# Defined to use origin/master instead of origin/main 17clspv=1 18clspv_llvm=1 19cpplint=1 20dxc=1 21glslang=1 22googletest=1 23json=1 24lodepng=1 25spirv_headers=1 26spirv_tools=1 27swiftshader=1 28vulkan_headers=1 29vulkan_loader=1 30vulkan_validationlayers=1 31 32 33# This script assumes it's parent directory is the repo root. 34repo_path=$(dirname "$0")/.. 35 36cd "$repo_path" 37 38if [[ $(git diff --stat) != '' ]]; then 39 echo "Working tree is dirty, commit changes before attempting to roll DEPS" 40 exit 1 41fi 42 43old_head=$(git rev-parse HEAD) 44 45for i in $(find third_party -maxdepth 1 -mindepth 1 -type d); do 46 name=`echo "${i%%/}" | cut -f2 -d'/' | tr '-' '_'` 47 48 if [ "x${name}" == "xcpplint" ]; then 49 continue 50 fi 51 52 trunk="origin/main" 53 if [ ! -z ${!name} ]; then 54 trunk="origin/master" 55 fi 56 57 roll-dep --ignore-dirty-tree --roll-to="${trunk}" "${i%%/}"; 58done 59 60git rebase --interactive "${old_head}" 61