2011-09-23 09:56:30 +08:00
|
|
|
# check the args
|
|
|
|
# $1: root of cocos2dx $2: app name $3: ndk root $4:pakcage path
|
|
|
|
|
|
|
|
APP_NAME=$2
|
|
|
|
COCOS2DX_ROOT=$1
|
2011-12-23 16:00:31 +08:00
|
|
|
APP_DIR=$COCOS2DX_ROOT/$APP_NAME
|
2011-09-23 09:56:30 +08:00
|
|
|
HELLOWORLD_ROOT=$COCOS2DX_ROOT/HelloWorld
|
|
|
|
NDK_ROOT=$3
|
|
|
|
PACKAGE_PATH=$4
|
|
|
|
|
2011-12-23 16:00:31 +08:00
|
|
|
# invoke android template
|
|
|
|
sh $(dirname "$0")/../android/copy_files.sh $1 $2 $3 $4
|
2011-09-23 09:56:30 +08:00
|
|
|
|
|
|
|
#copy linux's
|
|
|
|
move_files_into_linux(){
|
2012-02-15 17:39:10 +08:00
|
|
|
mkdir $APP_DIR/linux
|
|
|
|
for file in `ls $HELLOWORLD_ROOT/linux/* | grep -E '.*\.[cpp|h]' `
|
2011-09-23 09:56:30 +08:00
|
|
|
do
|
|
|
|
if [ -f $file ];then
|
2012-02-15 17:39:10 +08:00
|
|
|
cp $file $APP_DIR/linux
|
2011-09-23 09:56:30 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2012-01-04 15:00:14 +08:00
|
|
|
|
2011-09-23 09:56:30 +08:00
|
|
|
#copy eclipse configures
|
|
|
|
move_eclipse_configures_into(){
|
2012-02-15 17:39:10 +08:00
|
|
|
for file in `ls -a $HELLOWORLD_ROOT/linux/ | grep -E '\..*project' `
|
2011-09-23 09:56:30 +08:00
|
|
|
do
|
2012-02-15 17:39:10 +08:00
|
|
|
cp $HELLOWORLD_ROOT/linux/$file $APP_DIR/linux/
|
2011-09-23 09:56:30 +08:00
|
|
|
done
|
|
|
|
|
2012-02-15 17:39:10 +08:00
|
|
|
sed -i "s/HelloWorld/$APP_NAME/" $APP_DIR/linux/.project
|
2011-09-23 09:56:30 +08:00
|
|
|
|
2012-02-15 17:39:10 +08:00
|
|
|
sed -i "s/HelloWorld/$APP_NAME/" $APP_DIR/linux/.cproject
|
2011-09-23 09:56:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
move_files_into_linux
|
|
|
|
move_eclipse_configures_into
|