1_Export-designer.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # 策划使用的导出脚本
  3. cd `dirname $0`
  4. curdir=$(cd `dirname $0`;pwd)
  5. source ../bin/functions.sh
  6. start_time=$(date +%s)
  7. #echo "cur system "$OSTYPE
  8. if [[ "$OSTYPE" == "msys"* ]]; then
  9. echo "WINDOWS"
  10. exporter=../bin/exporter.exe
  11. elif [[ "$OSTYPE" == "darwin"* ]]; then
  12. echo "MAC"
  13. exporter=../bin/exporter
  14. chmod 777 $exporter
  15. else
  16. echo "config not support system "$OSTYPE
  17. exit
  18. fi
  19. ret=0
  20. function ExportText() {
  21. $exporter -skip-check=true $* &
  22. if [ "$?" != "0" ]; then
  23. ret=1
  24. fi
  25. }
  26. function CheckRet() {
  27. if [ "$?" != "0" ]; then
  28. ret=1
  29. fi
  30. }
  31. txtfmt=./fmt/txt.sheet.tpl
  32. configdir=../../../PC/LuaConfig
  33. txtConfigDir=../../../PC/TxtConfig
  34. exportluadir=../Export/Client
  35. if [ ! -d $exportluadir ]; then
  36. mkdir -p $exportluadir
  37. fi
  38. #echo "===start export to txt==="
  39. $exporter -skip-check=true -outs='[
  40. {"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":".txt"}
  41. ]' AudioConfig.xlsx LanguageConfig.xlsx
  42. CheckRet
  43. ExportText -tags=cn, -outs='[{"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":"_cn.txt"}]' TextConfig.xlsx LogicConfig/cs_文本配置.xlsx
  44. ExportText -tags=en, -outs='[{"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":"_en.txt"}]' TextConfig.xlsx LogicConfig/cs_文本配置.xlsx
  45. $exporter -skip-check=true -tags=tw, -outs='[
  46. {"Form":"raw","Out":"'$txtConfigDir'","Tpl":"'$txtfmt'","Ext":"_tw.txt"}
  47. ]' TextConfig.xlsx LogicConfig/cs_文本配置.xlsx
  48. CheckRet
  49. #echo "===export to lua==="
  50. luafmt=fmt/lua.sheet.tpl
  51. luatypefmt=fmt/lua.type.tpl
  52. luavertfmt=fmt/lua.vert.tpl
  53. luagroupfmt=fmt/lua.group.tpl
  54. uiidfmt=fmt/uiid.lua.tpl
  55. #files="globalconfig.xlsx uiconfig.xlsx"
  56. $exporter -t=TypeDefine -tags=c,v, -outs='[
  57. {"Form":"lua","Out":"'$configdir'","Tpl":"'$luafmt'","TypeTpl":"'$luatypefmt'","Tags":",c","Ext":".lua"},
  58. {"Form":"lua","Out":"'$configdir'","Tpl":"'$luavertfmt'","TypeTpl":"","Tags":"v","Ext":".lua"},
  59. {"Form":"lua","Out":"'$configdir'","Tpl":"'$luagroupfmt'","TypeTpl":"","Tags":"g","Ext":".lua"},
  60. {"Form":"raw","Out":"'$configdir'","Tpl":"'$uiidfmt'","sheets":"UIConfig:UIID","Ext":".lua"}
  61. ]' ./LogicConfig/lua_*.xlsx
  62. CheckRet
  63. cp $configdir/* $exportluadir
  64. CheckRet
  65. cp $txtConfigDir/* $exportluadir
  66. CheckRet
  67. wait
  68. end_time=$(date +%s)
  69. cost_time=$[ $end_time-$start_time ]
  70. echo "use time: $(($cost_time/60))min $(($cost_time%60))s"
  71. if [ "$ret" = "0" ]; then
  72. #CountDownExit 2
  73. echo "complete!"
  74. #sleep 1
  75. Pause
  76. else
  77. echo "******************parse error occured****************"
  78. Pause 'Press any key to continue...'
  79. sleep 0.5
  80. fi
  81. #Pause 'Press any key to continue...'