#!/bin/bash set -x for i in "$@"; do if [[ $i = *"="* ]]; then eval "$i" fi done cur_dir=$(cd $(dirname $0); pwd) share_dir=$cur_dir/.. obb_outputdir="E:/www/arpg" www_dir="" output_url="http://192.168.1.246:8000/test" stableAPK_dir="E:/www/arpg/released" dailyAPK_dir="E:/www/arpg/test" unity_app="C:/Unity/Editor/Unity.exe" output_dir=$share_dir/../build/android log_dir=$output_dir/../log/android build_graph="Assets/ZXToolkit/AssetGraph/Graph/BuildGraph.asset" arpg_cli_dir=$share_dir/../pandora_cli_proj arpg_pro_dir=$arpg_cli_dir/pandora if [ $publishChannel == "" ]; then publishChannel="google_oversea" fi if [ $isUsingNewAB == "true" ]; then build_graph="Assets/ZXToolkit/AssetGraph/Graph/BuildGraph_new.asset" fi buid_name=${buildNumber}_pandora_${publishChannel}_${version}_`date "+%Y%m%d_%H%M%S"` if [ $development == "true" ]; then buid_name=${buid_name}_development fi if [ $stable == "true" ]; then www_dir=$stableAPK_dir output_url="http://192.168.1.246:8000/released" else www_dir=$dailyAPK_dir fi if [ $obb == "true" ]; then buid_name=${buid_name}_obb fi packge_name="com.herogame.gplay.redtide2" outpath=$output_dir/${buid_name}.apk outobb=$output_dir/${buid_name}.main.obb obb_name=main.${version##*.}.$packge_name.obb if [ ! -d ${output_dir} ]; then mkdir ${output_dir} fi if [ ! -d ${log_dir} ]; then mkdir ${log_dir} fi cd $arpg_cli_dir # git fetch # git clean -f -d # git checkout -f $client_branch # if [ "$tag" != "" ]; then # git reset $tag --hard # fi # git pull # svn cleanup --remove-unversioned # svn revert --depth=infinity . # svn update python $arpg_cli_dir/../pandora_share_proj/MacBuild/build_generate_common.py debug=$debug version=$version disableLog=$disableLog versionIP="${versionIP}" gameIP=$gameIP lang=$lang maintenanceIP=$maintenanceIP mode=$mode publishChannel=$publishChannel # ret=$? # if [ $ret != 0 ]; then # exit $ret # fi # git_log_msg=`git --no-pager log --max-count 30 --since=1.days --pretty=format:"%s"` # git_log_msg=$(echo "$git_log_msg" | awk 'BEGIN{RS="\n";ORS="\\n";}{print $0}') # ret=$? # if [ $ret != 0 ]; then # cat ${log_dir}/${buid_name}.log # exit $ret # fi # ui=$arpg_cli_dir/arpg/Assets/RawResources/UI # # git add *.meta *.*.meta # # git commit -m "builder commit sprite tag" # # git pull # # git push # svn $ui add *.meta --force # svn $ui commit -m "builder commit sprite tag" $unity_app -quit -batchmode -projectPath $arpg_pro_dir -logFile ${log_dir}/${buid_name}.log -executeMethod XAsset.Build.AssetBuildScript.RunBuild version=$version channel=$channel outpath=$outpath development=$development versionIP=$versionIP lang=$lang buildNumber=$buildNumber rebuildBundle=$rebuildBundle isUsingUWATools=$isUsingUWATools isUsingUWAPoco=$isUsingUWAPoco mode=$mode target=$target publishChannel=$publishChannel graph=$build_graph thinkingAnalyticsMode=$thinkingAnalyticsMode ret=$? echo "buildFinish ret:${ret}" resources=$arpg_cli_dir/pandora/Assets/RawResources svn add $resources/*.meta --force svn commit $resources -m "builder commit" if [ ! -f ${outpath} ]; then echo "apk not found." cat ${log_dir}/${buid_name}.log exit 1 fi echo "copy to www" cp -f $outpath $www_dir/${buid_name}.apk obb_dir=$obb_outputdir/obb/$buildNumber obbinfo=$obb_outputdir/info/${buildNumber}_obbinfo if [ -f ${outobb} ]; then if [ ! -d ${obb_dir} ]; then mkdir ${obb_dir} fi cp -f $outobb $obb_dir/$obb_name python $share_dir/MacBuild/obb_postprocess.py $buildNumber $obb_dir/$obb_name $obb_outputdir/info fi # if [ "$no_home_page" != "true" ]; then # cd $www_dir/ # rm *.apk # cp -f $outpath $www_dir/${buid_name}.apk # rm -rf index.html # echo " # #
# #