1 Star 2 Fork 1

jnet/iOS_build_chameleon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build 2.34 KB
一键复制 编辑 原始数据 按行查看 历史
jnet 提交于 2015-08-06 17:54 . first commit
#!/usr/bin/env bash
#用法 ./doc/build.md
CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
echo "build"
#参数获取
INDEX=0
for param in $*
do
# echo $INDEX "--" $param
array[$INDEX]=$param
INDEX=$[ $INDEX+1 ]
done
PROJECT_PATH=${array[0]}
schemeTarget=${array[1]}
uuid=${array[3]}
cd "$PROJECT_PATH"
if [ -z "$PROJECT_PATH" ]; then
echo "请输入项目路径"
exit
fi
if [ -z "$schemeTarget" ]; then
echo "如果项目是workspace时,请输入scheme;如果项目是project时,请输入target"
exit
fi
CONFIGURATION=Debug
EMULATOR=1
deviceEmulator=--emulator
if [ -n "${array[2]}" ]; then
EMULATOR=0
CONFIGURATION=Release
fi
source "$CORDOVA_PATH/check_reqs"
# 判断是否存在workspace 并获取相应的项目信息
if [ ! $( ls "$PROJECT_PATH" | grep .xcworkspace ) ]; then
#项目名称
XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
else
#获取项目空间相应信息
XCWORKSPACE=$( ls "$PROJECT_PATH" | grep .xcworkspace )
XCWORKSPACE_NAME=$(basename "$XCWORKSPACE" .xcworkspace)
fi
if [ ! $( ls "$PROJECT_PATH" | grep .xcworkspace ) ]; then
#下面为对工程的编译
if (( $EMULATOR )); then
exec xcodebuild -project "$PROJECT_NAME.xcodeproj" -arch i386 -target "$schemeTarget" -configuration $CONFIGURATION -sdk iphonesimulator build VALID_ARCHS="i386" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/emulator"
else
exec xcodebuild -xcconfig "$CORDOVA_PATH/build.xcconfig" -project "$PROJECT_NAME.xcodeproj" ARCHS="armv7 armv7s arm64" -target "$schemeTarget" -configuration $CONFIGURATION -sdk iphoneos build VALID_ARCHS="armv7 armv7s arm64" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/device" PROVISIONING_PROFILE=$uuid
fi
else
# 以下为对项目空间的编译
if (( $EMULATOR )); then
exec xcodebuild -workspace "$XCWORKSPACE_NAME.xcworkspace" -arch i386 -scheme $schemeTarget -configuration $CONFIGURATION -sdk iphonesimulator build VALID_ARCHS="i386" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/emulator"
else
exec xcodebuild -xcconfig "$CORDOVA_PATH/build.xcconfig" -workspace "$XCWORKSPACE_NAME.xcworkspace" ARCHS="armv7 armv7s arm64" -scheme "$schemeTarget" -configuration $CONFIGURATION -sdk iphoneos build VALID_ARCHS="armv7 armv7s arm64" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/device" PROVISIONING_PROFILE=$uuid
fi
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/JNET/iOS_build_chameleon.git
[email protected]:JNET/iOS_build_chameleon.git
JNET
iOS_build_chameleon
iOS_build_chameleon
master

搜索帮助