mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:49:19 +02:00
Improves the APK build script
git-svn-id: trunk@36379 -
This commit is contained in:
parent
74ba11e83a
commit
63b7d2c263
@ -1,5 +1,6 @@
|
|||||||
REM Adjust these paths to yours
|
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 PATH=C:\Programas\android-sdk\tools;C:\Programas\android-sdk\platform-tools\;C:\Progra~1\Java\jdk1.6.0_20\bin
|
||||||
|
SET APP_NAME=androidlcltest
|
||||||
SET ANDROID_HOME=C:\Programas\android-sdk
|
SET ANDROID_HOME=C:\Programas\android-sdk
|
||||||
SET APK_SDK_PLATFORM=C:\Programas\android-sdk\platforms\android-8
|
SET APK_SDK_PLATFORM=C:\Programas\android-sdk\platforms\android-8
|
||||||
SET APK_PROJECT_PATH=F:\Programas\lazarussvn\examples\androidlcl\android
|
SET APK_PROJECT_PATH=F:\Programas\lazarussvn\examples\androidlcl\android
|
||||||
@ -11,16 +12,29 @@ mkdir gen\com
|
|||||||
mkdir gen\com\pascal
|
mkdir gen\com\pascal
|
||||||
mkdir gen\com\pascal\lcltest
|
mkdir gen\com\pascal\lcltest
|
||||||
|
|
||||||
|
REM Cleanup
|
||||||
|
del bin\%APP_NAME%.ap_
|
||||||
|
|
||||||
REM Resource compilation
|
REM Resource compilation
|
||||||
aapt p -f -M AndroidManifest.xml -F bin\androidlcltest.ap_ -I %APK_SDK_PLATFORM%\android.jar -S res -m -J gen
|
call aapt p -f -M AndroidManifest.xml -F bin\%APP_NAME%.ap_ -I %APK_SDK_PLATFORM%\android.jar -S res -m -J gen
|
||||||
|
aapt a bin\%APP_NAME%.ap_ libs\armeabi\liblclapp.so
|
||||||
|
|
||||||
REM Java compiler
|
REM Java compiler
|
||||||
javac -classpath %APK_SDK_PLATFORM%\android.jar -d bin\classes src\com\pascal\lcltest\LCLActivity.java
|
call 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
|
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
|
call dx --dex --output=%APK_PROJECT_PATH%\bin\classes.dex %APK_PROJECT_PATH%\bin\classes
|
||||||
|
|
||||||
|
REM It seams that dx calls echo off
|
||||||
|
@echo on
|
||||||
REM Now build the unsigned APK
|
REM Now build the unsigned APK
|
||||||
apkbuilder bin\androidlcltest-unsigned.apk -u -z bin\androidlcltest.ap_ -f bin\classes.dex
|
call apkbuilder %APK_PROJECT_PATH%\bin\%APP_NAME%-unsigned.apk -u -z %APK_PROJECT_PATH%\bin\%APP_NAME%.ap_ -f %APK_PROJECT_PATH%\bin\classes.dex
|
||||||
|
|
||||||
|
REM Generating on the fly a debug key
|
||||||
|
REM keytool -genkey -v -keystore bin\LCLDebugKey.keystore -alias LCLDebugKey -keyalg RSA -validity 10000 -dname NAME -keypass senhas
|
||||||
|
|
||||||
|
REM Signing the APK with a debug key
|
||||||
|
jarsigner -keystore bin\LCLDebugKey.keystore -keypass senhas -signedjar bin\%APP_NAME%.apk bin\%APP_NAME%-unsigned.apk LCLDebugKey
|
||||||
|
|
||||||
|
REM call and pause together allow us to see the results in the end
|
||||||
pause
|
pause
|
||||||
|
Loading…
Reference in New Issue
Block a user