blob: 160ecffea9f30bfddc4ede87453841f7a48a9114 [file] [log] [blame]
Matthias Braun32989732017-11-07 03:18:31 +00001# Get rid of the overly deep directory structures in the compiler artifacts
2#
3# After this script has run you should have $WORKSPACE/compiler/bin/clang etc.
4cd "compiler"
5# For the people with full xcode paths
6if [ -d "Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr" ]; then
7 if [ -d "usr" ]; then
8 rm -rf usr
9 fi
10 mv Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/* .
11 rm -rf Applications
12elif [ -d */bin ]; then
13# For people that have exactly 1 toplevel directory in their artifact
14# */bin/clang -> bin/clang
15 dir=$(dirname */bin)
16 for subdir in "$dir"/*
17 do
18 subdir_basename=$(basename $subdir)
19 if [ -d $subdir_basename ]; then
20 rm -rf $subdir_basename
21 fi
22 mv "$dir"/$subdir_basename .
23 done
24fi
25
26# Make sure there is a clang now
27cd "${WORKSPACE}"
28${WORKSPACE}/compiler/bin/clang -v