Merge pull request #1263 from dumganhar/gles20

Updated android template.
This commit is contained in:
James Chen 2012-08-30 03:31:18 -07:00
commit bddd7df779
3 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

33
template/android/.project Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>HelloCpp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -41,7 +41,7 @@ copy_src_and_jni(){
cp -rf $HELLOWORLD_ROOT/proj.android/jni $APP_DIR/proj.android
cp -rf $HELLOWORLD_ROOT/proj.android/src $APP_DIR/proj.android
# repalce Android.mk
# replace Android.mk
sh $COCOS2DX_ROOT/template/android/gamemk.sh $APP_DIR/proj.android/jni/Android.mk $NEED_BOX2D $NEED_CHIPMUNK $NEED_LUA
}
@ -56,6 +56,12 @@ copy_build_native(){
chmod u+x $APP_DIR/proj.android/build_native.sh
}
# copy .project and .classpath and replace project name
modify_project_classpath(){
sed "s/HelloCpp/$APP_NAME/" $COCOS2DX_ROOT/template/android/.project > $APP_DIR/proj.android/.project
cp -f $COCOS2DX_ROOT/template/android/.classpath $APP_DIR/proj.android
}
# replace AndroidManifext.xml and change the activity name
# use sed to replace the specified line
modify_androidmanifest(){
@ -91,6 +97,7 @@ copy_resouces
copy_src_and_jni
copy_library_src
copy_build_native
modify_project_classpath
modify_androidmanifest
modify_applicationdemo
modify_layout