[Android] Improve gradle build flow by automatically setting up the build directory - #119771
Conversation
e6a86dd to
09e9654
Compare
syntaxerror247
left a comment
There was a problem hiding this comment.
I have a few concerns here:
-
Users can extend the build directory with custom code and files, such as notification icons, modifying gradle dependencies, and other changes. If we auto delete the build directory when exporting from a newer version, users could accidentally lose those modifications. So instead, I think we should only install the build template when it is not already present. If there is a version mismatch, we should show a dialog with two actions: Open the existing build directory, so users can review or copy their modifications if needed. And delete and reinstall the gradle template.
-
We should also keep the
Install Android Build Templatemenu option. When the Android export template is not present or downloaded, it currently provides an option to Install from a file.
Removing this dialog would remove the ability to manually install a build template.
Manually setting up a build template is still possible either through the The pattern being observed is to improve the build flow by reducing the number of clicks required for setup. There are in general two scenarios a user may be going through, and both are addressed by the new flow:
|
Yeah I think we can go with this approach. We should also add a checkbox to allow users to specify |
9be8b66 to
07ed702
Compare
@syntaxerror247 I've updated the implementation. See the updated description. |
07ed702 to
5da6905
Compare
@m4gr3d problem is that I'd have to first export to generate the Removing |
|
I also personally like keeping the |
8a40e54 to
664ff25
Compare
|
@dsnopek @syntaxerror247 I've updated the implementation to keep the |
I don't think hiding a menu option behind an editor setting is a good idea. We should either have this setting or not have it at all. We can update the documentations to only mention the new export flow but I'd still prefer keeping this option for now and remove it in 5.0 (or maybe later 4.x releases). I just think that removing this option would be a big change. I'd ask Usability team to share their thoughts on removing |
I agree. My inclination would be to just leave the option in the menu for now. Most folks will hit on the automatic behavior by virtue of just going to export and everything working. And the folks who know they need the tool can continue to find it in the menu. There will be a short period where some people may continue using the tool, even though they really need it anymore, but this will likely fade with time |
The issue is that I am introducing a new button in #121849 to automatically download and setup the Android SDK, so following that PR, a user will have 3 UX to set up and configure their Android export:
The last button is now redundant with the functionality being added in this PR, except for expert users. So to avoid confusing regular users (which would be the vast majority), the current approach is to hide the last button by default, and provide a settings for expert users to bring it back if desired, similar to the approach used for the renderer selection drop-down. Another approach would be to merge the functionality of the
|
664ff25 to
a6ba0f2
Compare
|
Feedback from discussions with @dsnopek and @syntaxerror247:
|
a6ba0f2 to
02596fd
Compare
…rectory If not set up, the build directory will be automatically created and set up the first time the project is exported. A new editor setting (`export/android/build/automatically_delete_build_directory`) is added to control whether an existing but invalid build directory (e.g. mismatched versions due to upgrade) should be automatically deleted and reinstalled on build. If disabled, then the build fails with an error prompting the user to manually delete if needed.
02596fd to
0fa44d8
Compare
|
@dsnopek @syntaxerror247 I've addressed your feedback, the PR should be good to go! |
dsnopek
left a comment
There was a problem hiding this comment.
Thanks! I skimmed the code, and it looks good to me
I also test all use cases I normally use when developing for Android:
- Automatically installing when default export templates are present
- Automatically installing when export preset has custom export templates
- Using the original "Install Android Build Template..." dialog (both when export templates are present and not)
They all seemed to work great!
|
Thanks! |
This PR updates the setup of the gradle build environment as follow:
export/android/build/automatically_delete_build_directory, is added to control whether an existing but invalid build directory (e.g. mismatched versions due to editor upgrade) should be automatically deleted and reinstalled on build.export/android/build/automatically_delete_build_directoryeditor setting is disabled, then the build fails with an error prompting the user to manually delete the existing invalid build directory.Install Android Build Templatemenu option is hidden by default but can be restored via theexport/android/build/show_install_android_source_buttoneditor setting.