diff --git a/android/build.gradle b/android/build.gradle index 72468ce..b3b14a2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,6 +7,7 @@ def buildAutomatic = hasProperty('buildAutomatic') ? buildAutomatic : "true" def pEpAppPackageName = hasProperty('pEpAppPackageName') ? pEpAppPackageName : "com.pep.k9" def pEpEngineAndroid = new File(new File(pEpEngineSrc), 'build-android') +def pEpEngineDB = new File(new File(pEpEngineSrc), 'db') def libetpanAndroid = new File(new File(pEpEngineSrc), '../libetpan/build-android') def externalInstallDir = file('external/data/data/' + pEpAppPackageName + '/app_opt') @@ -99,12 +100,23 @@ android { unzipDeps.dependsOn buildpEpEngine } + // builds pEpEnginge's system.db + task buildpEpEngineSystemDB(type:Exec) { + workingDir pEpEngineDB + commandLine 'make', 'system.db' + } + // copy pEpEnginge's system.db to asset task cpDBAssets(type: Copy) { - from file(new File(new File(pEpEngineSrc), 'db/system.db')) + from file(new File(pEpEngineDB, 'system.db')) into 'assets' } + if(buildAutomatic=="true"){ + cpDBAssets.dependsOn buildpEpEngineSystemDB + } + + // call regular ndk-build(.cmd) script from app directory task jniBuild(type: Exec) { commandLine getNdkBuildCmd(), 'V=1', 'GPGBUILD='+externalInstallDir.absolutePath