关闭

Linux命令文件分离之SeparatePackageTool.sh

550人阅读 评论(0) 收藏 举报
分类:
echo "-----分离海外版本res资源开始-----"
rm -rf resFenli
mkdir resFenli
mkdir resFenli/font
mkdir resFenli/image
mkdir resFenli/image/ui
mkdir resFenli/language

mkdir resFenli/music
mkdir resFenli/particle
mkdir resFenli/particle/develop
mkdir resFenli/shader
mkdir resFenli/sound
mkdir resFenli/ui
mkdir resFenli/ui/common
mkdir resFenli/ui/develop
mkdir resFenli/ui/server

cp res/font/arts.ttf resFenli/font/arts.ttf
cp res/font/system.ttf resFenli/font/system.ttf


cp res/image/bg.plist resFenli/image/bg.plist

if [ -f "res/image/bg.png" ]; then
	cp res/image/bg.png resFenli/image/bg.png
fi	

if [ -f "res/image/bg.pkm" ]; then
	cp res/image/bg.pkm resFenli/image/bg.pkm
fi

cp res/image/loading.plist resFenli/image/loading.plist
cp res/image/loading.png resFenli/image/loading.png
cp res/image/text_icon.plist resFenli/image/text_icon.plist
cp res/image/text_icon.png resFenli/image/text_icon.png
cp res/image/prop_icon.plist resFenli/image/prop_icon.plist
cp res/image/prop_icon.png resFenli/image/prop_icon.png

cp res/image/ui/bottom_tips.png resFenli/image/ui/bottom_tips.png
cp res/image/ui/common2.plist resFenli/image/ui/common2.plist
cp res/image/ui/common2.png resFenli/image/ui/common2.png

cp -R res/language resFenli/

cp res/music/login_bgm.mp3 resFenli/music/login_bgm.mp3

cp res/particle/develop/logo.plist resFenli/particle/develop/logo.plist
cp res/particle/develop/logo.png resFenli/particle/develop/logo.png

#将res下整个shader文件夹放到resFenli下面
cp -R res/shader resFenli/

cp res/sound/ui_button_click.mp3 resFenli/sound/ui_button_click.mp3

cp -R res/ui/common resFenli/ui
cp -R res/ui/develop resFenli/ui
cp -R res/ui/server resFenli/ui
cp res/ui/new_loading.csb resFenli/ui/new_loading.csb
cp res/ui/new_update.csb resFenli/ui/new_update.csb

echo "-----删除原先res资源-----"

rm -rf res

echo "-----将临时文件resFenli重命名为res-----"

mv resFenli res

echo "-----分离海外版本res资源完成-----"

版本2:新增Android和IOS控制不同的包体积大小

read -p "输入平台(Android, IOS):" platform
while [ true ]; do
	if [ $platform = "Android" ]; then
		break
	elif [ $platform = "IOS" ]; then
		break
	else
		read -p "输入错误请重新输入平台(Android, IOS):" platform
	fi 
done

echo "-----分离海外版本res资源开始-----"
rm -rf resFenli
mkdir resFenli
mkdir resFenli/font
mkdir resFenli/image
mkdir resFenli/image/ui
mkdir resFenli/language

mkdir resFenli/music
mkdir resFenli/particle
mkdir resFenli/particle/develop
mkdir resFenli/shader
mkdir resFenli/sound
mkdir resFenli/ui
mkdir resFenli/ui/common
mkdir resFenli/ui/develop
mkdir resFenli/ui/server

cp -R res/font resFenli/

#拷贝cg动画和skip资源

cp overseaRes/skip.png resFenli/image/skip.png

cp -R overseaRes/video resFenli/


#
cp res/image/loading04.plist  resFenli/image/loading04.plist 
if [ -f "res/image/loading04.png" ]; then
	cp res/image/loading04.png resFenli/image/loading04.png
fi	

if [ -f "res/image/loading04.pvr.ccz" ]; then
	cp res/image/loading04.pvr.ccz resFenli/image/loading04.pvr.ccz
fi	


cp res/image/bg.plist resFenli/image/bg.plist
if [ -f "res/image/bg.png" ]; then
	cp res/image/bg.png resFenli/image/bg.png
fi	

if [ -f "res/image/bg.pkm" ]; then
	cp res/image/bg.pkm resFenli/image/bg.pkm
fi

if [ -f "res/image/bg.pvr.ccz" ]; then
	cp res/image/bg.pvr.ccz resFenli/image/bg.pvr.ccz
fi


cp res/image/loading.plist resFenli/image/loading.plist
if [ -f "res/image/loading.png" ]; then
	cp res/image/loading.png resFenli/image/loading.png
fi

if [ -f "res/image/loading.pvr.ccz" ]; then
	cp res/image/loading.pvr.ccz resFenli/image/loading.pvr.ccz
fi


cp res/image/text_icon.plist resFenli/image/text_icon.plist
if [ -f "res/image/text_icon.png" ]; then
	cp res/image/text_icon.png resFenli/image/text_icon.png
fi

if [ -f "res/image/text_icon.pvr.ccz" ]; then
	cp res/image/text_icon.pvr.ccz resFenli/image/text_icon.pvr.ccz
fi


cp res/image/prop_icon.plist resFenli/image/prop_icon.plist
if [ -f "res/image/prop_icon.pvr.ccz" ]; then
	cp res/image/prop_icon.pvr.ccz resFenli/image/prop_icon.pvr.ccz
fi

if [ -f "res/image/prop_icon.png" ]; then
	cp res/image/prop_icon.png resFenli/image/prop_icon.png
fi


cp res/image/ui/bottom_tips.png resFenli/image/ui/bottom_tips.png


cp res/image/ui/common2.plist resFenli/image/ui/common2.plist
cp res/image/ui/common2.png resFenli/image/ui/common2.png

cp -R res/language resFenli/

cp res/music/login_bgm.mp3 resFenli/music/login_bgm.mp3

cp res/particle/develop/logo.plist resFenli/particle/develop/logo.plist
cp res/particle/develop/logo.png resFenli/particle/develop/logo.png

#将res下整个shader文件夹放到resFenli下面
cp -R res/shader resFenli/

cp res/sound/ui_button_click.mp3 resFenli/sound/ui_button_click.mp3

cp -R res/ui/common resFenli/ui
cp -R res/ui/develop resFenli/ui
cp -R res/ui/server resFenli/ui
cp res/ui/new_loading.csb resFenli/ui/new_loading.csb
cp res/ui/new_update.csb resFenli/ui/new_update.csb


if [ $platform = "Android" ]; then
	echo "-----新增拷贝Android资源保持到100M左右-----"

	cp -R res/image resFenli/
	cp -R res/particle resFenli/
    rm -rf resFenli/image/sea
    rm -rf resFenli/image/ship

elif [ $platform = "IOS" ]; then
	echo "-----新增拷贝IOS资源保持包在85M左右-----"
	cp -R res/image resFenli/
	cp -R res/particle resFenli/

    rm -rf resFenli/image/sea
    rm -rf resFenli/image/ship

    rm -rf resFenli/image/battle
    rm -rf resFenli/image/ship_big
    rm -rf resFenli/image/ship_small
    rm -rf resFenli/image/weather
    # rm -rf resFenli/particle/buff   #不注释的话, 包再增加4.2M左右

else
	echo "有异常!"
	exit 0
fi

echo "------删除原先res资源-----"

rm -rf res

echo "-----将临时文件resFenli重命名为res-----"

mv resFenli res

echo "-----分离海外版本res资源完成-----"





   
0
0
查看评论
发表评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场

linux mkfs命令参数及用法详解---linux格式化文件系统命令(包括swap分区)

mkfs 命令  linux格式化磁盘命令              linux mkfs         指令:mkfs   使用权限 : 超级使用者 ...
  • pugu12
  • pugu12
  • 2015-07-25 08:43
  • 4365

find命令的基础用法以及按文件修改时间查找文件

一般文件查找方法: find 命令学好是一件很有趣的事情,也可以帮你在查找系统文件的时候事倍功半,还可以与正则表达式结合使用,功能强大,是一个很好的查找工具。可以整体提高你的系统管理能力。 ...
  • MiltonZhong
  • MiltonZhong
  • 2013-05-20 15:24
  • 3025

用rz,sz命令在windows和linux之间传输文件

转自http://www.linuxmine.com/178.html 有很多人没有听说过ZModem协议,更不知道有rz/sz这样方便的工具; 下面一段是从SecureCRT的帮助中copy的: ...
  • Jacklee1212
  • Jacklee1212
  • 2015-04-13 15:08
  • 2342

startup.sh linux 启动jar包命令

  • 2017-09-21 09:58
  • 857B
  • 下载

FFmpeg .sh文件命令解释

# NDK地址 NDK=/Users/biezhihua/software/android-ndk-r13b # 工具链目录 PREBUILT=$NDK/toolchains/arm-linux...
  • caonidayeheixiu8
  • caonidayeheixiu8
  • 2017-12-08 11:30
  • 20

Linux 搭建Hadoop集群执行命令start-dfs.sh报错 permission denied

错误信息如下:ubuntu@ubuntu:~$ start-dfs.sh --config /usr/soft/hadoop-2.6.3/etc/hadoop_pseudo/Starting name...
  • GZDXrenmin
  • GZDXrenmin
  • 2016-02-19 10:15
  • 4104

linux 环境下使用shutdown.sh命令无法关闭tomcat 进程

互联网开发模式的经验之谈>>> »   1.Red Hat 4.8.2-16 版本的Linux系统,安装jdk1.7.0_79和apache-tomcat-8.0.26,使用shutdown...
  • ljj_9
  • ljj_9
  • 2016-12-05 14:53
  • 1410

linux下执行.sh文件的方法和语法

linux下执行.sh文件的方法    .sh文件就是文本文件,如果要执行,需要使用chmod a+x xxx.sh来给可执行权限。       是bash脚本么   可以用touch te...
  • ljp812184246
  • ljp812184246
  • 2016-09-19 15:04
  • 25742

解决 linux下编译.sh文件报错 “[: XXXX: unexpected operator” 问题

经常在linux通过编译 .sh文件来生成工程,之前一直都没问题,代码一直都没变,但是今天编译的时候,却提示错误:         然后我就表示很费解,查看我的.sh文件,其...
  • liuligui5200
  • liuligui5200
  • 2016-09-10 09:21
  • 523

解决 linux下编译.sh文件报错 “[: XXXX: unexpected operator” 问题

本人经常在linux通过编译 .sh文件来生成工程,之前一直都没问题,代码一直都没变,但是今天编译的时候,却提示错误:        然后我就表示很费解,查看我的.sh文件,其中有很多的[] ,都是这...
  • liuqiyao_01
  • liuqiyao_01
  • 2014-11-27 19:07
  • 5274
    个人资料
    • 访问:752880次
    • 积分:18389
    • 等级:
    • 排名:第585名
    • 原创:1090篇
    • 转载:21篇
    • 译文:0篇
    • 评论:58条
    最新评论
    python入门专栏
    介绍python的最基础的知识