Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* gradle plugin: arguments support for launch* tasks #789

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dkimitsa
Copy link
Contributor

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

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

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant