Permalink
Browse files

Updated build system

  • Loading branch information...
1 parent daeec87 commit 0a64ebee1c1380796d7fd33f2f0a9ae28e6b4b23 @pelya committed Oct 17, 2012
View
@@ -28,3 +28,6 @@
[submodule "project/jni/application/openarena/vm"]
path = project/jni/application/openarena/vm
url = https://github.com/pelya/openarena-vm
+[submodule "project/jni/application/teeworlds-0.7/src"]
+ path = project/jni/application/teeworlds-0.7/src
+ url = git://github.com/pelya/teeworlds.git
View
@@ -23,7 +23,7 @@ if ( grep "package $AppFullName;" project/src/Globals.java > /dev/null && \
[ "`readlink AndroidAppSettings.cfg`" -ot "project/src/Globals.java" ] && \
[ -z "`find project/java/* project/AndroidManifestTemplate.xml -cnewer project/src/Globals.java`" ] && \
[ -z "`find project/jni/application/src/AndroidData/* -cnewer project/src/Globals.java`" ] ) ; then true ; else
- ./ChangeAppSettings.sh -a
+ ./changeAppSettings.sh -a
sleep 1
touch project/src/Globals.java
fi
@@ -42,7 +42,12 @@ if uname -s | grep -i "windows" > /dev/null ; then
fi
rm -r -f project/bin/* # New Android SDK introduced some lame-ass optimizations to the build system which we should take care about
-cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j$NCPU && \
+[ -x project/jni/application/src/AndroidPreBuild.sh ] && {
+ cd project/jni/application/src
+ ./AndroidPreBuild.sh || { echo "AndroidPreBuild.sh returned with error" ; exit 1 ; }
+ cd ../../../..
+}
+cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j$NCPU V=1 && \
{ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
echo Stripping libapplication.so by hand && \
rm obj/local/armeabi/libapplication.so && \
@@ -58,6 +63,7 @@ cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j
cp jni/application/src/libapplication-armeabi-v7a.so libs/armeabi-v7a/libapplication.so && \
`which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-4.6/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so \
|| true ; } && \
+ cd .. && ./copyAssets.sh && cd project && \
ant debug && \
$install_apk && [ -n "`adb devices | tail -n +2`" ] && \
{ cd bin && adb install -r MainActivity-debug.apk | grep 'Failure' && \
@@ -989,17 +989,6 @@ done
rm -rf project/bin/classes
rm -rf project/bin/res
-mkdir -p project/assets
-rm -f project/assets/*
-if [ -d "project/jni/application/src/AndroidData" ] ; then
- echo Copying asset files
- cp project/jni/application/src/AndroidData/* project/assets/
- for F in project/assets/*; do
- if [ `cat $F | wc -c` -gt 1000000 ] ; then
- echo "The file $F is bigger than 1 megabyte - splitting it into smaller chunks"
- split -b 1000000 -d $F $F && rm $F || { echo "Error: 'split' command not installed" ; exit 1 ; }
- fi
- done
-fi
+./copyAssets.sh || exit 1
echo Done
View
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+echo "Copying app data files from project/jni/application/src/AndroidData to project/assets"
+mkdir -p project/assets
+rm -f project/assets/*
+if [ -d "project/jni/application/src/AndroidData" ] ; then
+ echo Copying asset files
+ cp project/jni/application/src/AndroidData/* project/assets/
+ for F in project/assets/*; do
+ if [ `cat $F | wc -c` -gt 1000000 ] ; then
+ echo "The file $F is bigger than 1 megabyte - splitting it into smaller chunks"
+ split -b 1000000 -d $F $F && rm $F || { echo "Error: 'split' command not installed" ; exit 1 ; }
+ fi
+ done
+fi
+exit 0
@@ -2,7 +2,7 @@ APP_PROJECT_PATH := $(call my-dir)/..
APP_STL := gnustl_static
APP_CFLAGS := -O3 -DNDEBUG -g # arm-linux-androideabi-4.4.3 crashes in -O0 mode on SDL sources
-APP_PLATFORM := android-8
+APP_PLATFORM := android-9 # Android 2.3.0 or newer, includes EGL headers
include jni/Settings.mk
Oops, something went wrong.

0 comments on commit 0a64ebe

Please sign in to comment.