android - Set applicationApk and instrumentationApk for Spoon Gradle Plugin -


i'd set .apk files used run tests spoongradleplugin.

there available properties can set programatically gradle file:

https://github.com/stanfy/spoon-gradle-plugin/blob/master/src/main/groovy/com/stanfy/spoon/gradle/spoonextension.groovy

but project has various flavours , names , i'd test them. current setup get:

* went wrong: problem found configuration of task ':app:spoondebugandroidtest'. > file '/users/f1sherkk/dev/myapp-android/app/build/outputs/apk/app-debug.apk' specified property 'applicationapk' not exist. 

my build names are:

app-debug-androidtest-unaligned.apk myapp-debuga-1.2.3-201.apk myapp-debugb-1.2.3-201.apk myapp-debugc-1.2.3-201.apk 

that's why setup .apk somewhere in gradle code - or console. found far there fields available in spoon gradle plugin there:

https://github.com/stanfy/spoon-gradle-plugin/blob/master/src/main/groovy/com/stanfy/spoon/gradle/spoonruntask.groovy

with names:

  /** instrumentation apk. */   @inputfile   file instrumentationapk    /** application apk. */   @inputfile   file applicationapk 

but can't access in gradle properties in spoonextension.groovy.

is there way setup fields?

//edit - added tries: base spoon config:

spoon {     debug = true     baseoutputdir = file("$builddir/spoon-log")     if (project.hasproperty('spoonclassname')) {         classname = project.spoonclassname          if (project.hasproperty('spoonmethodname')) {             methodname = project.spoonmethodname         }     } } 

and tasks extending , overwriting instumentationargs set package , launch other kind of tests.

task spoonalltests(type: gradlebuild, dependson: ['spoon']) {     spoon {         instrumentationargs = ["package=com.myapp.sendmoney.instrumentation"]     } }  task spoonflowtests(type: gradlebuild, dependson: ['spoon']) {     spoon {         instrumentationargs = ["package=com.myapp.instrumentation.flowtests"]     } } 

and try edit applicationapk or instrumentationapk file:

enter image description here

enter image description here

enter image description here

edit2: tried new thing:

task spoonflowtests(type: gradlebuild, dependson: ['spoon']) {     spoon {         inputs.property("applicationapk", "$builddir/outputs/apk/ap12345p-debug.apk")         inputs.property("instrumentationapk", "$builddir/outputs/apk/ap125p-debug.apk")         println inputs.getfiles()         println inputs.getproperties()         instrumentationargs = ["package=com.azimo.sendmoney.instrumentation.flowtests"]     } } 

and terminal response:

2015-10-26 20:24:12 [sr.runtests] executing instrumentation suite on 0 device(s). 2015-10-26 20:24:12 [sr.runtests] application: com.azimo.sendmoney.debug1 /users/f1sherkk/dev/azimo-android/app/build/outputs/apk/app-debug.apk 2015-10-26 20:24:12 [sr.runtests] instrumentation: com.azimo.sendmoney.debug1.test /users/f1sherkk/dev/azimo-android/app/build/outputs/apk/app-debug-androidtest-unaligned.apk :app:spoon :app:spoonflowtests file collection {instrumentationapk=/users/f1sherkk/dev/azimo-android/app/build/outputs/apk/ap125p-debug.apk, applicationapk=/users/f1sherkk/dev/azimo-android/app/build/outputs/apk/ap12345p-debug.apk} :azimo-android:app:help  welcome gradle 2.5.  run build, run gradlew <task> ...  see list of available tasks, run gradlew tasks  see list of command-line options, run gradlew --help  see more detail task, run gradlew --task <task>  build successful  total time: 13.289 secs 

please see my answer different question explaining wrong how configure tasks.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -