Several tasks not accessable in build.gradle file in connection with Android Studio -
i found weird behaviour in android studio.
i want access dexdebug task in module build.gradle file.
apply plugin: 'com.android.application' android { compilesdkversion 22 buildtoolsversion "22.0.1" defaultconfig { applicationid "com.testprj.test" minsdkversion 10 targetsdkversion 22 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dexdebug.dofirst { // stuff here } but following error: error:(rownumber, 0) not find property 'dexdebug' on project ':app'.
that's weird because can call task on android studio terminal via gradle dexdebug.
what reason it?
create own task:
task mytask() { } make task "process stuff" before dexdebug:
gradle.taskgraph.whenready { taskgraph -> if (taskgraph.hastask(dexdebug)) { // <-- check if task ready dexdebug.dependson mytask // <-- make depend on task } }
Comments
Post a Comment