Detect Android deployment target from Gradle build file -


i'm looking extend gradle build call external tool. issue need provide current cpu architecture being targeted, example armeabi or arm64-v8a if user has chosen deploy physical device. having trouble finding way of determining information in gradle build file.

currently performing action in custom task runs before prebuild, similar this solution. there way detect cpu architecture @ point?

task customtask(type: exec) {     commandline "mytool.exe", "-architecture=$something" }  prebuild.dependson customtask 

i'm using experimental plugin 0.7.0-beta3.

thanks

you can cpu architecture (abi) of connected device adb shell command:

adb shell getprop ro.product.cpu.abi 

for nexus 5 return armeabi-v7a example.

now have wrap command gradle method:

def getdeviceabi() {     return "adb shell getprop ro.product.cpu.abi".execute().text.trim() } 

then can call method task:

task customtask(type: exec) {     commandline "mytool.exe", "-architecture=" + getdeviceabi() } prebuild.dependson customtask 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -