Issue
I have to following gradle code:
testOptions {
unitTests.returnDefaultValues = true
unitTests.all {
// All the usual Gradle options.
jvmArgs '-XX:MaxPermSize=1024m'
}
execution 'ANDROID_TEST_ORCHESTRATOR'
}
And I am using Android test orchestrator, but I makes my UI tests take a lot of time to run. So I would like to be able to request for orchestrator in the command line like:
./gradlew androidConnectedCheck --orchestrator
So I can controll when to use orchestator. Is it possible to do that with gradle?
Edit:
I am not interested in using a gradle variable in my code (in Java or Kotlin) I would like to create a conditional test configuration accordingly with my command line
Solution
./gradlew androidConnectedCheck -Porchestrator
And in gradle, you can do:
def orchestrator = project.hasProperty('orchestrator')
orchestrator
will be true if it was passed as an arg. This uses the project-prop built into gradle command line.
Answered By - Jon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.