lundi 1 février 2016

Task for changing the AndroidTest runner

I'm trying to setup a task that will setup a different runner in the android gradle plugin.

My idea is to have something like:

./gradlew differentRunner connectedAndroidTest

That would run androidTests with a different runner.

What I have so far:

task differentRunner << {
    project.android.defaultConfig.testInstrumentationRunner = "com.example.DifferentRunner"
    println 'Different runner set.'
}

But, even though I see the log printed when issuing the above mentioned command, tests are run with the runner set in defaultConfig.

How could I achieve this?

P.S. I know I could use flavours, but those are just not an option for me, I would like to setup a custom task.

Aucun commentaire:

Enregistrer un commentaire