NewCreature / T3-Framework

A framework for setting up and using Allegro 5
http://www.t3-i.com/t3f.htm
6 stars 1 forks source link

Add Android Support to Project Build System #16

Open NewCreature opened 12 years ago

NewCreature commented 12 years ago

After messing with the Android port of Allegro, I think it should be possible to automate the build process to produce an Android APK for deployment. I would like to simplify it to the point that you could just type 'make android_package' to compile your project for Android.

The process would likely involve copying the source files to a temp folder which contains the Android project structure. The 'makefile.android' script should take care of everything for you so you can just write your application like normal.

Some Android support files (basically an Android project template) will need to be included as part of T3F. The project builder will copy these to your new project so you won't have to do anything extra to get Android support.

NewCreature commented 12 years ago

I will probably use sed to replace info in the Android project template with the info supplied in your project's 'makefile.defines'. This means I will be temporarily duplicating the Android project template when building the project for Android.

* DONE *

NewCreature commented 12 years ago

I will probably need to add some Android-specific variables to 'makefile.defines'.

* DONE *

NewCreature commented 12 years ago

Android support is working. Still need to make the script modify the proper files in the Android project template so everything will match up with our app (stuff defined in makefile.defines).

Still need to copy Allegro shared objects into the temp directory where the Android project is being built.

* NEEDS TESTING *

Also need to make a way for this to work with multiple architectures. Will probably ask to specify the architecture in the make command. Might consider building multiple architectures automatically if there turns out to be a need.

(specified architecture in 'Android.mk' with 'sed' at project build time) * NEEDS TESTING *

Should include the architecture in the filename so we don't get confused about which APK belongs to which architecture.

* DONE *

NewCreature commented 12 years ago

Need to support .cpp source files.

NewCreature commented 12 years ago

Need to check for certain environment variables and tell user to define them if they are not already defined. Will need ANDROID_NDK_ROOT, ANDROID_SDK_ROOT, and ANDROID_ARCHITECTURE. The command to build would then be: make android_project ANDROID_NDK_DOOT=/home/wherever ANDROID_SDK_ROOT=/home/wherever ANDROID_ARCHITECTURE=armeabi/x86/whatever the user wants.

If there are standard environment variable names, we should use those instead since users might already have them defined.