Browse Source

PEMA-107 Compile for only connected devices if running from IDE

pull/25/head
ignaciogarcia 3 years ago
parent
commit
7ccf3a97c5
No known key found for this signature in database GPG Key ID: 5E6A455C909DD623
  1. 15
      android/build.gradle

15
android/build.gradle

@ -119,9 +119,9 @@ android {
} }
// call external build (GnuPG, GPGME, etc) // call external build (GnuPG, GPGME, etc)
task buildExternal(dependsOn: ['genSources', 'setpEpJNIAdapterArchs']) { task buildExternal(dependsOn: ['genSources']) {
doLast { doLast {
println("compiling for abis: ${project.archsToCompile}") println("buildExternal for abis: ${project.archsToCompile}")
exec { exec {
workingDir 'external' workingDir 'external'
commandLine 'make', "-j${threadsToUse}", 'build', "archs=${project.archsToCompile}" commandLine 'make', "-j${threadsToUse}", 'build', "archs=${project.archsToCompile}"
@ -160,10 +160,19 @@ android {
if(buildAutomatic == "true") { if(buildAutomatic == "true") {
buildpEpEngineSystemDB.dependsOn(buildExternal) buildpEpEngineSystemDB.dependsOn(buildExternal)
} }
if(isIdeBuild()) {
buildExternal.dependsOn(setpEpJNIAdapterArchs)
}
// 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)
} }
def isIdeBuild() {
boolean runningFromIde = project.properties['android.injected.invoked.from.ide'] == 'true'
if (runningFromIde) {
println("GRADLE RUNNING FROM IDE")
}
return runningFromIde
}

Loading…
Cancel
Save