Browse Source

Android : ensure that gnupg assets are included at first build

JNI-44
Edouard Tisserant 10 years ago
parent
commit
92d3c9769d
  1. 37
      android/build.gradle
  2. 4
      android/external/Makefile

37
android/build.gradle

@ -74,7 +74,12 @@ android {
// call external build (GnuPG, GPGME, etc) // call external build (GnuPG, GPGME, etc)
task buildExternal(type:Exec) { task buildExternal(type:Exec) {
workingDir 'external' workingDir 'external'
commandLine 'make', 'all', 'PEP_PACKAGE_NAME='+pEpAppPackageName commandLine 'make', 'build', 'PEP_PACKAGE_NAME='+pEpAppPackageName
}
task externalAssets(type:Exec) {
workingDir 'external'
commandLine 'make', 'assets', 'PEP_PACKAGE_NAME='+pEpAppPackageName
} }
task cleanExternal(type:Exec) { task cleanExternal(type:Exec) {
@ -89,9 +94,6 @@ android {
environment['LIBETPAN_PATH'] = libetpanAndroid.absolutePath environment['LIBETPAN_PATH'] = libetpanAndroid.absolutePath
commandLine './build.sh' commandLine './build.sh'
} }
if(buildAutomatic=="true"){
buildpEpEngine.dependsOn buildExternal
}
// unzip some of the dependencies // unzip some of the dependencies
task unzipDeps(type: Copy) { task unzipDeps(type: Copy) {
@ -102,10 +104,6 @@ android {
into file("${buildDir}") into file("${buildDir}")
} }
if(buildAutomatic=="true"){
unzipDeps.dependsOn buildpEpEngine
}
// builds pEpEnginge's system.db // builds pEpEnginge's system.db
task buildpEpEngineSystemDB(type:Exec) { task buildpEpEngineSystemDB(type:Exec) {
workingDir pEpEngineDB workingDir pEpEngineDB
@ -118,11 +116,12 @@ android {
into 'assets' into 'assets'
} }
if(buildAutomatic=="true"){ // This ensures that assets are populated before collecting resources.
cpDBAssets.dependsOn buildpEpEngineSystemDB libraryVariants.all { variant ->
variant.preBuild.dependsOn(cpDBAssets)
variant.preBuild.dependsOn(externalAssets)
} }
// call regular ndk-build(.cmd) script from app directory // call regular ndk-build(.cmd) script from app directory
task jniBuild(type: Exec) { task jniBuild(type: Exec) {
// In case ndk-gdb works one day, add: 'NDK_DEBUG=1', // In case ndk-gdb works one day, add: 'NDK_DEBUG=1',
@ -130,26 +129,26 @@ android {
} }
jniBuild.dependsOn genSources jniBuild.dependsOn genSources
jniBuild.dependsOn unzipDeps jniBuild.dependsOn unzipDeps
jniBuild.dependsOn cpDBAssets
// Ensure this is done before java build // Ensure this is done before java build
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn jniBuild compileTask -> compileTask.dependsOn jniBuild
} }
assemble.dependsOn unzipDeps
task jniClean(type: Exec) { task jniClean(type: Exec) {
commandLine getNdkBuildCmd(), 'clean', 'GPGBUILD='+externalInstallDir.absolutePath commandLine getNdkBuildCmd(), 'clean', 'GPGBUILD='+externalInstallDir.absolutePath
ignoreExitValue = true
} }
clean.dependsOn jniClean
if(buildAutomatic=="true"){ if(buildAutomatic=="true"){
buildpEpEngine.dependsOn buildExternal
externalAssets.dependsOn buildExternal
unzipDeps.dependsOn buildpEpEngine
cpDBAssets.dependsOn buildpEpEngineSystemDB
clean.dependsOn cleanExternal clean.dependsOn cleanExternal
// ndk-build clean complains when .so are missing
// ensure jniClean happens before external clean
cleanExternal.dependsOn jniClean
}else{
clean.dependsOn jniClean
} }
} }

4
android/external/Makefile

@ -14,7 +14,9 @@ APP_ABI ?= armeabi-v7a
APP_PLATFORM ?= android-14 APP_PLATFORM ?= android-14
PEP_PACKAGE_NAME ?= com.pep.pepjniaaractivity PEP_PACKAGE_NAME ?= com.pep.pepjniaaractivity
all: libetpan-build gnupg-install gpgme-install assets all: build assets
build: libetpan-build gnupg-install gpgme-install
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Manage paths for PREFIX, DESTDIR, LOCAL and PATH # Manage paths for PREFIX, DESTDIR, LOCAL and PATH

Loading…
Cancel
Save