#!/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/.. root_dir=/Volumes/PackageDisk/www/arpg if [[ $uploadDir != "" ]]; then root_dir=$uploadDir fi www_dir=$root_dir unity_app="/Applications/Unity/Unity.app/Contents/MacOS/Unity" 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=arpg_${publishChannel}_${version}_`date "+%Y%m%d_%H%M%S"` if [ $development == "true" ]; then buid_name=${buid_name}_development fi output_dir=$share_dir/../build/android log_dir=$output_dir/../log/android build_file_name=${buid_name}.apk if [ $mode == "aab" ]; then build_file_name=${buid_name}.aab www_dir=${www_dir}/android elif [ $mode == "apk" ]; then www_dir=${www_dir}/android elif [ $mode == "ios" ]; then www_dir=${www_dir}/ios output_dir=$share_dir/../build/ios log_dir=$output_dir/../log/ios fi outpath=$output_dir/${build_file_name} if [ ! -d ${output_dir} ]; then mkdir ${output_dir} fi if [ ! -d ${log_dir} ]; then mkdir ${log_dir} fi #python $arpg_cli_dir/tools/jenkins_script/generate_local_update_zip.py "false" cd $arpg_cli_dir # svn cleanup --remove-unversioned # svn revert --depth=infinity . # svn update python $arpg_cli_dir/../arpg_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 killall Unity $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 mode=$mode target=$target publishChannel=$publishChannel graph=$build_graph thinkingAnalyticsMode=$thinkingAnalyticsMode ret=$? echo "buildFinish ret:${ret}" resources=$arpg_cli_dir/arpg/Assets/RawResources # svn add $resources/*.meta --force # svn commit $resources -m "builder commit" ui=$arpg_cli_dir/arpg/Assets/RawResources/UI svn add $ui/*.meta --force svn commit $ui -m "builder commit sprite tag" ui2=$arpg_cli_dir/arpg/Assets/RawResources/UI2 svn add $ui2/*.meta --force svn commit $ui2 -m "builder commit sprite tag" if [ ! -f ${outpath} ]; then echo "apk not found." cat ${log_dir}/${buid_name}.log exit 1 fi echo "copy to www" if [[ $root_dir =~ "@" ]] then if [ $mode == "aab" ]; then scp $outpath $www_dir/release_aab/${build_file_name} scp $output_dir/${buid_name}_original.aab $www_dir/original_aab/${buid_name}_original.aab chmod 777 $output_dir/${buid_name}.apks scp $output_dir/${buid_name}.apks $www_dir/apks/${buid_name}.apks scp $output_dir/${version}_aab.zip $www_dir/split_assets/${version}_aab.zip elif [ $mode == "apk" ]; then scp $outpath $www_dir/apk/${build_file_name} fi else if [ $mode == "aab" ]; then cp -f $outpath $www_dir/release_aab/${build_file_name} cp -f $output_dir/${buid_name}_original.aab $www_dir/original_aab/${buid_name}_original.aab chmod 777 $output_dir/${buid_name}.apks cp -f $output_dir/${buid_name}.apks $www_dir/apks/${buid_name}.apks cp -f $output_dir/${version}_aab.zip $www_dir/split_assets/${version}_aab.zip elif [ $mode == "apk" ]; then cp -f $outpath $www_dir/apk/${build_file_name} fi 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 " # #
# #