Created
August 29, 2013 15:41
-
-
Save heistak/6379752 to your computer and use it in GitHub Desktop.
Cygwin script to automate build of Mikulus Kinect for Mac/Windows and copy .zip to Dropbox.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#----------------------------------------------------------------------------------------------- | |
# Unityをバッチモードで起動し、ビルドする | |
#----------------------------------------------------------------------------------------------- | |
# These are defined in Cygwin, but used by Mono's compilation. | |
unset TEMP | |
unset TMP | |
# Cygwin C:\ Path | |
C=/cygdrive/c | |
WINHOMEWIN="C:\Users\username" | |
WINHOMECYG=$C/Users/username | |
# Unityアプリパス | |
UNITY_APP_PATH=$C/Program\ Files\ \(x86\)/Unity/Editor/Unity.exe | |
# 対象のUnityプロジェクトパス | |
UNITY_PROJECT_PATH="$WINHOMEWIN\Documents\MikulusKinect" | |
UNITY_PROJECT_PATH_CYG="$WINHOMECYG/Documents/MikulusKinect" | |
# バッチモードで起動後に呼び出すメソッド | |
UNITY_BATCH_EXECUTE_METHOD=BatchBuild.ReleaseBuild | |
# Unity Editor ログファイルパス | |
UNITY_EDITOR_LOG_PATH=$WINHOMECYG/AppData/Local/Unity/Editor/Editor.log | |
BUILD_PATH=$UNITY_PROJECT_PATH_CYG/Build/Mikulus\ Kinect/ | |
DROPBOX_PATH=$WINHOMECYG/Dropbox/Unity/ | |
mkdir "$BUILD_PATH" | |
# 指定のUnityプロジェクトをバッチモード起動させて、指定のメソッドを呼び出す | |
run "$UNITY_APP_PATH" -wait -batchmode -quit -projectPath $UNITY_PROJECT_PATH -executeMethod $UNITY_BATCH_EXECUTE_METHOD | |
# Unityでのbuildに失敗した場合は終了 | |
if [ $? -eq 1 ]; then | |
cat $UNITY_EDITOR_LOG_PATH | |
exit 1 | |
fi | |
# Unity Editorが出力したログを表示する | |
cat $UNITY_EDITOR_LOG_PATH | |
# Copy Readme | |
cp $UNITY_PROJECT_PATH_CYG/Assets/Documentation/*.txt "$BUILD_PATH" | |
# Create zip archive | |
cd "$BUILD_PATH" | |
rm "$UNITY_PROJECT_PATH_CYG/Build/MikulusKinect.zip" | |
zip "$UNITY_PROJECT_PATH_CYG/Build/MikulusKinect.zip" -r ./* | |
# Copy Build to Dropbox for crossplatform sharing | |
cp "$UNITY_PROJECT_PATH_CYG/Build/MikulusKinect.zip" "$DROPBOX_PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment