Home | History | Annotate | Download | only in scripts
      1 #!/bin/sh
      2 
      3 
      4 # This script will install the files from a "Debug" or "Release" build
      5 # directory into the developer folder specified.
      6 
      7 NUM_EXPECTED_ARGS=2
      8 
      9 PROGRAM=`basename $0`
     10 
     11 if [ $# -ne $NUM_EXPECTED_ARGS ]; then
     12 	echo This script will install the files from a 'Debug' or 'Release' build directory into the developer folder specified.
     13 	echo "usage: $PROGRAM <BUILD_DIR> <DEVELOPER_DIR>";
     14 	echo "example: $PROGRAM ./Debug /Developer"
     15 	echo "example: $PROGRAM /build/Release /Xcode4"
     16 	exit 1;
     17 fi
     18 
     19 BUILD_DIR=$1
     20 DEVELOPER_DIR=$2
     21 
     22 if [ -d $BUILD_DIR ]; then
     23 	if [ -d $DEVELOPER_DIR ]; then
     24 		if [ -e "$BUILD_DIR/debugserver" ]; then
     25 			echo Updating "$DEVELOPER_DIR/usr/bin/debugserver"
     26 			sudo rm -rf "$DEVELOPER_DIR/usr/bin/debugserver"
     27 			sudo cp "$BUILD_DIR/debugserver" "$DEVELOPER_DIR/usr/bin/debugserver"
     28 		fi
     29 
     30 		if [ -e "$BUILD_DIR/lldb" ]; then
     31 			echo Updating "$DEVELOPER_DIR/usr/bin/lldb"
     32 			sudo rm -rf "$DEVELOPER_DIR/usr/bin/lldb"
     33 			sudo cp "$BUILD_DIR/lldb" "$DEVELOPER_DIR/usr/bin/lldb"
     34 		fi
     35 
     36 		if [ -e "$BUILD_DIR/libEnhancedDisassembly.dylib" ]; then
     37 			echo Updating "$DEVELOPER_DIR/usr/lib/libEnhancedDisassembly.dylib"
     38 			sudo rm -rf "$DEVELOPER_DIR/usr/lib/libEnhancedDisassembly.dylib"
     39 			sudo cp "$BUILD_DIR/libEnhancedDisassembly.dylib" "$DEVELOPER_DIR/usr/lib/libEnhancedDisassembly.dylib"
     40 		fi
     41 
     42 		if [ -d "$BUILD_DIR/LLDB.framework" ]; then
     43 			echo Updating "$DEVELOPER_DIR/Library/PrivateFrameworks/LLDB.framework"
     44 			sudo rm -rf "$DEVELOPER_DIR/Library/PrivateFrameworks/LLDB.framework"
     45 			sudo cp -r "$BUILD_DIR/LLDB.framework" "$DEVELOPER_DIR/Library/PrivateFrameworks/LLDB.framework"
     46 		elif [ -e "$BUILD_DIR/LLDB.framework" ]; then
     47 			echo BUILD_DIR path to LLDB.framework is not a directory: "$BUILD_DIR/LLDB.framework"
     48 			exit 2;			
     49 		fi
     50 	
     51 	else
     52 		echo DEVELOPER_DIR must be a directory: "$DEVELOPER_DIR"
     53 		exit 3;	
     54 	fi
     55 
     56 else
     57 	echo BUILD_DIR must be a directory: "$BUILD_DIR"
     58 	exit 4;	
     59 fi
     60