robovm icon indicating copy to clipboard operation
robovm copied to clipboard

* gradle plugin: arguments support for launch* tasks

Open dkimitsa opened this issue 1 year ago • 0 comments

These changes allows to pass arguments to application, when launching it on device/simulator similar to arguments field in Idea run/debug configuration. Beside debug/specific cases this is also required to enable debug mode of Crashlytics: https://firebase.google.com/docs/crashlytics/test-implementation?platform=ios

Custom commands are supported since Gradle v5. Usage as simple as: ./gradlew launchIPhoneSimulator --info --args "'hello world'"

String passed in --args is then tokenized into individual arguments, e.g. --args="one two" will produce two arguments in args array ["one", "two"], if spaces to be considered as part of argument, quotation to be used.

Gradle also propagate option description to help command:

./gradlew help --task launchIPhoneSimulator

> Task :help
Detailed task information for launchIPhoneSimulator

Path
     :launchIPhoneSimulator

Type
     IPhoneSimulatorTask (org.robovm.gradle.tasks.IPhoneSimulatorTask)

Options
     --args     Command line arguments passed to app.

Description
     Runs your iOS app in the iPhone simulator

Group
     MobiVM

dkimitsa avatar May 19 '24 17:05 dkimitsa