Browse Source

added engine source gen steps to build.gradle

JNI-44
Hussein Kasem 9 years ago
parent
commit
4e981f7a90
  1. 26
      android/build.gradle

26
android/build.gradle

@ -93,18 +93,28 @@ android {
} }
// call source generation makefile target // call source generation makefile target
task genSources(type:Exec) { task genSources(type:Exec, dependsOn: 'genpEpEngineSyncSources') {
workingDir '../src' workingDir '../src'
commandLine 'make', 'gensource' commandLine 'make', 'gensource'
} }
task genpEpEngineSyncSources(type:Exec, dependsOn: 'genpEpEngineAsn1Sources') {
workingDir '../../pEpEngine'
commandLine 'make', '-C', 'sync'
}
task genpEpEngineAsn1Sources(type:Exec) {
workingDir '../../pEpEngine'
commandLine 'make', '-C', 'asn.1', 'generate'
}
task cleanGenSource(type:Exec) { task cleanGenSource(type:Exec) {
workingDir '../src' workingDir '../src'
commandLine 'make', 'clean' commandLine 'make', 'clean'
} }
// call external build (GnuPG, GPGME, etc) // call external build (GnuPG, GPGME, etc)
task buildExternal(type:Exec) { task buildExternal(type:Exec, dependsOn: 'genSources') {
workingDir 'external' workingDir 'external'
commandLine 'make', 'build', 'PEP_PACKAGE_NAME='+pEpAppPackageName commandLine 'make', 'build', 'PEP_PACKAGE_NAME='+pEpAppPackageName
} }
@ -125,7 +135,7 @@ android {
} }
// unzip some of the dependencies // unzip some of the dependencies
task unzipDeps(type: Copy) { task unzipDeps(type: Copy, dependsOn: 'buildExternal') {
from zipTree(libEtPanZip) from zipTree(libEtPanZip)
into file("${buildDir}") into file("${buildDir}")
} }
@ -137,7 +147,7 @@ android {
} }
// copy pEpEnginge's system.db to asset // copy pEpEnginge's system.db to asset
task cpDBAssets(type: Copy) { task cpDBAssets(type: Copy, dependsOn: 'buildpEpEngineSystemDB') {
from file(new File(pEpEngineDB, 'system.db')) from file(new File(pEpEngineDB, 'system.db'))
into 'assets' into 'assets'
} }
@ -145,13 +155,13 @@ android {
// This ensures that assets are populated before collecting resources. // This ensures that assets are populated before collecting resources.
preBuild.dependsOn(cpDBAssets) preBuild.dependsOn(cpDBAssets)
preBuild.dependsOn(externalAssets) preBuild.dependsOn(externalAssets)
preBuild.dependsOn(genSources)
unzipDeps.dependsOn buildExternal //unzipDeps.dependsOn buildExternal
//Should be modified to build automatic only build external not engine or engine db //Should be modified to build automatic only build external not engine or engine db
// if(buildAutomatic=="true"){ if(buildAutomatic == "true") {
preBuild.dependsOn(genSources)
// //
// buildpEpEngineDebug.dependsOn buildExternal // buildpEpEngineDebug.dependsOn buildExternal
// externalAssets.dependsOn buildExternal // externalAssets.dependsOn buildExternal
@ -160,7 +170,7 @@ android {
// //
// clean.dependsOn cleanExternal // clean.dependsOn cleanExternal
// clean.dependsOn cleanpEpEngine // clean.dependsOn cleanpEpEngine
// } }
} }

Loading…
Cancel
Save