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

fix: use variant arg in build-android command #1798

Conversation

adamTrz
Copy link
Collaborator

@adamTrz adamTrz commented Jan 16, 2023

Summary:

Fixes: facebook/react-native#35838

If variant is passed to run-android command we still should respect it.

Test Plan:

  • yarn react-native run-android --mode FullDebug --verbose should output ./gradlew app:installFullDebug
  • yarn react-native run-android --variant FullDebug --verbose should output ./gradlew app:installFullDebug
  • yarn react-native build-android --mode FullDebug --verbose should output ./gradlew app:assembleFullDebug
  • yarn react-native build-android --variant FullDebug --verbose should output ./gradlew app:assembleFullDebug

@szymonrybczak
Copy link
Collaborator

Hey @adamTrz, after some conversation on issue #1796, I found that docs are not updated, see here. It can be confusing - #1796 (comment), and actually we've that in the codebase, here, so you could you please add info about that --variant is depracted to docs? 😄

@adamTrz adamTrz force-pushed the fix/use-variant-in-run-android-command branch from c659e09 to d2fa723 Compare January 16, 2023 21:56
@github-actions github-actions bot added the docs Documentation change label Jan 16, 2023
@adamTrz adamTrz force-pushed the fix/use-variant-in-run-android-command branch from d2fa723 to d3ed617 Compare January 17, 2023 08:43
@@ -16,14 +16,17 @@ import tryLaunchAppOnDevice from './tryLaunchAppOnDevice';
import tryLaunchEmulator from './tryLaunchEmulator';
import tryInstallAppOnDevice from './tryInstallAppOnDevice';
import {Flags} from '.';
import {BuildFlags} from '../buildAndroid';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now we have a circular reference between buildAndroid and runOnAllDevices


export function getTaskNames(
appName: string,
commands: Array<string>,
args: BuildFlags,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of leaking whole args to a helper function. Can we convert that into explicit arguments? Either as an object or a arg list, I'm fine with both

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix that circular reference and getTaskNames fn signature and we can ship it

@adamTrz adamTrz force-pushed the fix/use-variant-in-run-android-command branch from d3ed617 to 0705f50 Compare January 17, 2023 16:43
@thymikee
Copy link
Member

@adamTrz please verify my latest updates and we're good to go :)

@adamTrz adamTrz merged commit 2f4cfa5 into react-native-community:main Jan 18, 2023
@adamTrz adamTrz deleted the fix/use-variant-in-run-android-command branch January 18, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix docs Documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task 'installDebug' not found in project ':app' after upgrading to 0.71
4 participants