GoogleChromeLabs / bubblewrap

Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Apache License 2.0
2.36k stars 161 forks source link

Bubblewrap should suggest the standard SDK location ~/Android/Sdk #794

Closed christianhujer closed 1 year ago

christianhujer commented 1 year ago
$ bubblewrap init --manifest https://chatncharge.nelkinda.com/manifest.json
,-----.        ,--.  ,--.  ,--.
|  |) /_,--.,--|  |-.|  |-.|  |,---.,--.   ,--,--.--.,--,--.,---.
|  .-.  |  ||  | .-. | .-. |  | .-. |  |.'.|  |  .--' ,-.  | .-. |
|  '--' '  ''  | `-' | `-' |  \   --|   .'.   |  |  \ '-'  | '-' '
`------' `----' `---' `---'`--'`----'--'   '--`--'   `--`--|  |-'
                                                           `--'    
? Do you want Bubblewrap to install JDK?
  (Enter "No" to use your JDK installation) No
? Path to your existing JDK: /home/christian.hujer/.sdkman/candidates/java/11.0.19.fx-zulu/
? Do you want Bubblewrap to install Android SDK?
  (Enter "No" to use your installation) No
? Path to your existing Android SDK: 

My Android SDK is in the default location ~/Android/Sdk. bubblewrap should auto-detect and suggest that.

Is your feature request related to a problem? Please describe. It's frustrating to have to tell the machine something it could easily figure out by itself.

Describe the solution you'd like I'd like bubblewrap to detect the Android SDK path using standard mechanisms, then ask me whether it guessed correctly, and only ask me to enter the installation path manually if the standard detection mechanisms failed or I am not satisfied with the guess.

Describe alternatives you've considered It could also be nice if bubblewrap init would support command line arguments to define preset answers to questions like the JDK and Android SDK locations. And it would be nice if the help text for init mentions that all these questions do is setup jdkPath and androidSdkPath in ~/.bubblewrap/config.json. Would I have known that, I would've skipped bubblewrap init and instead directly created .bubblewrap/config.json myself.

andreban commented 1 year ago

IMO, this will be more of a footgun, since there's a big change the existing SDK from Android Studio may introduce incompatibilities.

christianhujer commented 1 year ago

So, is it recommended from a Bubblewrap perspective to have Bubblewrap install an additional Android Sdk?

andreban commented 1 year ago

Closing this down, as suggesting the default SDK is likely to create more issues for users than solve.