-
Notifications
You must be signed in to change notification settings - Fork 932
feat: Pass along CLI port configuration for Android #421
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,10 @@ function runOnAllDevices( | |
| const tasks = args.tasks || ['install' + toPascalCase(args.variant)]; | ||
| const gradleArgs = getTaskNames(args.appFolder, tasks); | ||
|
|
||
| if (args.port != null) { | ||
| gradleArgs.push('-PreactNativeDevServerPort=' + args.port); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quick q: Why this is called
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's how you can pass parameters to Gradle, something like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Directly from the gradlew usage stuff: Having no space is definitely confusing.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, gotcha, thanks! I read it "Preact" and asked myself what's going on 😂 Thank you for explaining it! |
||
| } | ||
|
|
||
| logger.info('Installing the app...'); | ||
| logger.debug( | ||
| `Running command "cd android && ${cmd} ${gradleArgs.join(' ')}"`, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use stricter equal operator
!==. Or is it used on purpose here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured the value could be undefined if the argument wasn't provided, but I also wasn't sure if it could ever be null too.
I bet I could make this
"port" in argsorargs.port !== undefinedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args.portcan be:undefined,NaN(we're passing string input throughNumber()),numberThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess
if(args.port)would be less confusing in that case :D