123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #!/bin/bash
- # 策划使用的导出脚本
- cd `dirname $0`
- curdir=$(cd `dirname $0`;pwd)
- source ../bin/functions.sh
- start_time=$(date +%s)
- #echo "cur system "$OSTYPE
- if [[ "$OSTYPE" == "msys"* ]]; then
- echo "WINDOWS"
- exporter=../bin/exporter.exe
- elif [[ "$OSTYPE" == "darwin"* ]]; then
- echo "MAC"
- exporter=../bin/exporter
- chmod 777 $exporter
- else
- echo "config not support system "$OSTYPE
- exit
- fi
- ret=0
- function ExportText() {
- $exporter -skip-check=true $* &
- if [ "$?" != "0" ]; then
- ret=1
- fi
- }
- function CheckRet() {
- if [ "$?" != "0" ]; then
- ret=1
- fi
- }
- txtfmt=./fmt/txt.sheet.tpl
- configdir=../../../PC/LuaConfig
- txtConfigDir=../../../PC/TxtConfig
- exportluadir=../Export/Client
- if [ ! -d $exportluadir ]; then
- mkdir -p $exportluadir
- fi
- #echo "===start export to txt==="
- $exporter -skip-check=true -outs='[
- {"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":".txt"}
- ]' AudioConfig.xlsx LanguageConfig.xlsx
- CheckRet
- ExportText -tags=cn, -outs='[{"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":"_cn.txt"}]' TextConfig.xlsx LogicConfig/cs_文本配置.xlsx
- ExportText -tags=en, -outs='[{"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":"_en.txt"}]' TextConfig.xlsx LogicConfig/cs_文本配置.xlsx
- $exporter -skip-check=true -tags=tw, -outs='[
- {"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":"_tw.txt"}
- ]' TextConfig.xlsx LogicConfig/cs_文本配置.xlsx
- CheckRet
- #echo "===export to lua==="
- luafmt=fmt/lua.sheet.tpl
- luatypefmt=fmt/lua.type.tpl
- luavertfmt=fmt/lua.vert.tpl
- luagroupfmt=fmt/lua.group.tpl
- uiidfmt=fmt/uiid.lua.tpl
- #files="globalconfig.xlsx uiconfig.xlsx"
- $exporter -t=TypeDefine -tags=c,v, -outs='[
- {"Form":"lua","Out":"'$configdir'","Tpl":"'$luafmt'","TypeTpl":"'$luatypefmt'","Tags":",c","Ext":".lua"},
- {"Form":"lua","Out":"'$configdir'","Tpl":"'$luavertfmt'","TypeTpl":"","Tags":"v","Ext":".lua"},
- {"Form":"lua","Out":"'$configdir'","Tpl":"'$luagroupfmt'","TypeTpl":"","Tags":"g","Ext":".lua"},
- {"Form":"raw","Out":"'$configdir'","Tpl":"'$uiidfmt'","sheets":"UIConfig:UIID","Ext":".lua"}
- ]' ./LogicConfig/lua_*.xlsx
- CheckRet
- cp $configdir/* $exportluadir
- CheckRet
- cp $txtConfigDir/* $exportluadir
- CheckRet
- wait
- end_time=$(date +%s)
- cost_time=$[ $end_time-$start_time ]
- echo "use time: $(($cost_time/60))min $(($cost_time%60))s"
- if [ "$ret" = "0" ]; then
- #CountDownExit 2
- echo "complete!"
- #sleep 1
- Pause
- else
- echo "******************parse error occured****************"
- Pause 'Press any key to continue...'
- sleep 0.5
- fi
- #Pause 'Press any key to continue...'
|