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

Add development flavor #1214

Merged
merged 3 commits into from
Mar 20, 2024
Merged

Add development flavor #1214

merged 3 commits into from
Mar 20, 2024

Conversation

hjiangsu
Copy link
Member

Pull Request Description

This PR adds flavors to Thunder (mostly dev-facing feature for now). When we run a debug build of Thunder on a physical device, the debug build stops working when we disconnect the debugger. Therefore, to use Thunder outside of development, I have to run a profile/release build after I finish all dev-related tasks. This was a bit of a hassle so I decided to implement flavors.

For now, this PR adds two flavors: production and development.

  • The production flavor is the general release/nightly builds of Thunder (e.g., profile/release builds)
  • The development flavor is for any in-development feature builds of Thunder (e.g., debug builds). The only difference is the color of the icon to help differentiate it a bit. Future enhancements to this would be to add a separate splash screen to indicate the flavor.
  • We can further extend this in the future to provide a nightly flavor for nightly builds.

The benefit of this is that we can now compare between two different versions of Thunder by running different versions on different flavors.

Issue Being Fixed

Issue Number: N/A

Screenshots / Recordings

image

simulator_screenshot_96FA35CF-02F7-4EC4-B6FE-8064E74790ED

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

Ooh, this looks like a great idea!

By any chance is there a way to show the flavor name in the home screen?

@hjiangsu
Copy link
Member Author

By any chance is there a way to show the flavor name in the home screen?

I was trying this out, but it looks weird on iOS because theres a 12 character limit before iOS removes spaces. So Thunder Development would end up being ThunderDevelopment. I'm not too sure if Android has the same restrictions too. I was thinking a better way to distinguish them would be to change up the icon a bit more (maybe add a badge or something similar) to visually separate the flavors.

@micahmo
Copy link
Member

micahmo commented Mar 20, 2024

thinking a better way to distinguish them would be to change up the icon a bit more (maybe add a badge or something similar)

I like that idea!

@hjiangsu
Copy link
Member Author

This is the best I was able to come up with - having text with the logo is a bit tough since the area is so small. Hopefully, this is large enough to distinguish the letters

image

image

simulator_screenshot_4E7CD5E7-E8F1-4716-B941-AA0B3C85AF0A

@micahmo
Copy link
Member

micahmo commented Mar 20, 2024

Oh I think that looks awesome!! It's not too small at all.

@hjiangsu
Copy link
Member Author

I'll go ahead and merge this in, and we can add more tweaks to the design later if we want to!

@hjiangsu hjiangsu merged commit dd69a5e into develop Mar 20, 2024
1 check passed
@hjiangsu hjiangsu deleted the feature/dev-flavor branch March 20, 2024 23:43
@micahmo
Copy link
Member

micahmo commented Mar 21, 2024

The build command I usually use for my phone is

flutter build apk --profile --no-tree-shake-icons

It seems to still work, but now spits out

Gradle build failed to produce an .apk file. It's likely that this file was generated under .\build, but the tool couldn't find it.

Is this because the naming of the .apk changed? Should I change my command?

@hjiangsu
Copy link
Member Author

Ahh you have to add --flavor development or --flavor production to generate the build. It produces app-development-release.apk or app-production-release.apk because of the flavor.

@hjiangsu
Copy link
Member Author

I've also adjusted the VSCode launch.json to provide support for launching the different flavors. You might be able to use that as well!

image

@micahmo
Copy link
Member

micahmo commented Mar 21, 2024

you have to add --flavor development or --flavor production to generate the build

Thanks, that worked!

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.

None yet

2 participants