From dbf6d2c8f6888fdcd1ea5da3d48e409bb280b030 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Mon, 26 Mar 2012 15:47:26 +0000 Subject: [PATCH] First version of a non-ant build system for the Android APK git-svn-id: trunk@36346 - --- .gitattributes | 1 + .../androidlcl/android/build_debug_apk.bat | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 examples/androidlcl/android/build_debug_apk.bat diff --git a/.gitattributes b/.gitattributes index 52bfa0645a..811554f12c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3472,6 +3472,7 @@ examples/androidlcl/android/AndroidManifest.xml svneol=native#text/plain examples/androidlcl/android/build.properties svneol=native#text/plain examples/androidlcl/android/build.sh svneol=native#text/plain examples/androidlcl/android/build.xml svneol=native#text/plain +examples/androidlcl/android/build_debug_apk.bat svneol=native#text/plain examples/androidlcl/android/default.properties svneol=native#text/plain examples/androidlcl/android/local.properties svneol=native#text/plain examples/androidlcl/android/res/drawable-hdpi/icon.png -text svneol=unset#image/png diff --git a/examples/androidlcl/android/build_debug_apk.bat b/examples/androidlcl/android/build_debug_apk.bat new file mode 100644 index 0000000000..484bcf6cf1 --- /dev/null +++ b/examples/androidlcl/android/build_debug_apk.bat @@ -0,0 +1,26 @@ +REM Adjust these paths to yours +SET PATH=C:\Programas\android-sdk\tools;C:\Programas\android-sdk\platform-tools\;C:\Progra~1\Java\jdk1.6.0_20\bin +SET ANDROID_HOME=C:\Programas\android-sdk +SET APK_SDK_PLATFORM=C:\Programas\android-sdk\platforms\android-8 +SET APK_PROJECT_PATH=F:\Programas\lazarussvn\examples\androidlcl\android + +mkdir bin +mkdir bin\classes +mkdir gen +mkdir gen\com +mkdir gen\com\pascal +mkdir gen\com\pascal\lcltest + +REM Resource compilation +aapt p -f -M AndroidManifest.xml -F bin\androidlcltest.ap_ -I %APK_SDK_PLATFORM%\android.jar -S res -m -J gen + +REM Java compiler +javac -classpath %APK_SDK_PLATFORM%\android.jar -d bin\classes src\com\pascal\lcltest\LCLActivity.java + +REM DX to convert the java bytecode to dalvik bytecode +dx --dex --no-strict --output=%APK_PROJECT_PATH%\bin\classes.dex %APK_PROJECT_PATH%\bin\classes\com\pascal\lcltest\LCLActivity.class + +REM Now build the unsigned APK +apkbuilder bin\androidlcltest-unsigned.apk -u -z bin\androidlcltest.ap_ -f bin\classes.dex + +pause