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

[Wallet] Make it easier to build and run the different envs #5191

Merged
merged 15 commits into from
Oct 9, 2020

Conversation

jeanregisser
Copy link
Contributor

@jeanregisser jeanregisser commented Sep 24, 2020

Description

This PR makes it easier to build the app in the different envs we have.

  • We now have the following env files, which are mapped to Xcode schemes/Android flavors:
    • .env.alfajores
    • .env.alfajoresdev
    • .env.mainnet
    • .env.mainnetdev
    • .env.test
  • Supports both debug/release for all envs (for release builds, the js bundle and assets are included in the app package)
  • Supports "dev" variants for day-to-day use by developers, can be installed alongside the store apps
  • Usage: yarn dev:ios -e %envName% or yarn dev:android -e %envName%, (%envName% can be alfajores, alfajoresdev, mainnet, mainnetdev or test), add the -r flag to produce a release build which doesn't need the packager running
  • Other run_app.sh script improvements:
    • can build iOS too from the command line (no need to have Xcode running 🎉) and now launches the packager in a different terminal window respecting the user choice of terminal
    • doesn't need to dynamically update the google services plist anymore. This should prevent using the wrong firebase db
    • App can still be launched through Xcode: Screenshot 2020-09-25 at 10 57 28
    • App can also be run from Android Studio if needed: Screenshot 2020-09-25 at 15 22 02
  • Removed unused pilot and integration networks
  • Removed google service configs referencing the deprecated celo-org-mobile Firebase project.

Finally it is relatively simple to add new envs if needed.

Other changes

  • Upgraded react-native-config

Tested

Successfully ran:

  • yarn dev:ios
  • yarn dev:ios -e aflajoresdev
  • yarn dev:ios -e aflajores
  • yarn dev:ios -e mainnetdev
  • yarn dev:ios -e mainnet
  • yarn dev:ios -r
  • yarn dev:android
  • yarn dev:android -e aflajoresdev
  • yarn dev:android -e aflajores
  • yarn dev:android -e mainnetdev
  • yarn dev:android -e mainnet
  • yarn dev:android -r
  • yarn test:e2e:ios
  • yarn test:e2e:ios -r
  • yarn test:e2e:android (release mode (-r) option doesn't work yet as it fails at runtime due to proguard not keeping some Kotlin classes used by detox).
  • bundle exec fastlane ios mainnet (though manually disabling upload)
  • bundle exec fastlane android mainnet (though manually disabling upload)

Related issues

Backwards compatibility

Yes

- Supports both debug/release for all envs (js bundle is generated for release builds)
- Supports "dev" variants for day-to-day use, can be installed alongside the store apps
- run_app.sh script can build iOS too and now launches the packager in a different terminal window respecting the user choice of terminal
Also tentative to make it work in release mode
@jeanregisser jeanregisser marked this pull request as ready for review September 25, 2020 13:46
@jeanregisser jeanregisser requested a review from a team September 25, 2020 13:46
Copy link
Contributor

@gnardini gnardini left a comment

Choose a reason for hiding this comment

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

This looks amazing!! Do you think we'll be able to use release builds for e2e tests now? That would reduce some of the flakiness that is caused by intermittent warnings that cover the bottom of the screen.

Copy link
Contributor

@tarikbellamine tarikbellamine left a comment

Choose a reason for hiding this comment

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

This is awesome! Please open an github issue for this to close.

@jeanregisser
Copy link
Contributor Author

This looks amazing!! Do you think we'll be able to use release builds for e2e tests now? That would reduce some of the flakiness that is caused by intermittent warnings that cover the bottom of the screen.

Yes, iOS e2e tests in release mode already works!
Android is still problematic but very close.
I manually made the e2e test release build work by enabling multidex, but then it failed at runtime due to proguard not keeping some Kotlin classes used by detox. Which could be easily solved by disabling proguard in that configuration.
Though there might be other issues 👀

@jeanregisser jeanregisser added the automerge Have PR merge automatically when checks pass label Oct 9, 2020
@mergify mergify bot merged commit 8283f0e into master Oct 9, 2020
@mergify mergify bot deleted the jeanregisser/easy-env-switch branch October 9, 2020 13:04
mergify bot pushed a commit that referenced this pull request Oct 23, 2020
### Description

Following the switch to Android flavors in #5191, the mapping path became incorrect.

### Tested

`bundle exec fastlane android alfajores` works.

### Related issues

- Discussed on Slack

### Backwards compatibility

Yes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Developers should be able to easily build and run the app for the different supported envs
3 participants