Matthias Braun | 3298973 | 2017-11-07 03:18:31 +0000 | [diff] [blame] | 1 | # 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. |
| 4 | cd "compiler" |
| 5 | # For the people with full xcode paths |
| 6 | if [ -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 |
| 12 | elif [ -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 |
| 24 | fi |
| 25 | |
| 26 | # Make sure there is a clang now |
| 27 | cd "${WORKSPACE}" |
| 28 | ${WORKSPACE}/compiler/bin/clang -v |