-
Notifications
You must be signed in to change notification settings - Fork 30
expose the api to get preferred jdk infos #142
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
Conversation
tondat
commented
Oct 26, 2021
- VisualStudio needs to know the list of preferred jdk infos to set the default jdk on the android settings property page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is supposed to be internal for a reason, are you able to use this instead? https://github.com/xamarin/xamarin-android-tools/blob/4c2e36c757c8a8d7da48ca1ffa97240f3602ec85/src/Xamarin.Android.Tools.AndroidSdk/JdkInfo.cs#L284
no, this is the error, the explanation is in the bug https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1415418 |
{ | ||
logger = logger ?? AndroidSdkInfo.DefaultConsoleLogger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a file logger that can be used? What if the process doesn't have a console?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client is responsible to set the logger, in our case XamarinVS caller.
I have added it to be compatible with all the methods in this class that check the logger or assign the default if it is a null parameter
@tondat : I would prefer that XamarinVS call |
we cannot do that, we have a dialog (UI) and I need this value, when user accept it I changed the value and I need to refresh the AndroidSDK of androditools. So I need this api public, to get the installed JDK and I cannot use the GetKnownSystemJdkInfos because it gives priority to the preferred path and it can be a custom path defined for the user and I need the default installed by willow. Full explanation in the bug: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1415418 |
@tondat: I don't follow. VSMac also has a dialog (UI), and does use Now, VSMac doesn't show what the path will be changed to; it just has a Reset to Defaults button. …though now that I look at VSMac, it's wrong, in that the Reset to Defaults button is disabled if the value hasn't changed! (Meaning if you change the JDK path to anything, quit VSMac, restart VSMac, and return to the Android Locations tab, the button is disabled. Lol/sigh.) |
@tondat: Given that the VSMac UX is hilariously bad, I'll concede that we do need a new method. Thus, naming: we've "overloaded" the adjective "preferred"; we're using it as:
Just writing the above is confusing, actually. Thus, yes, we should add a new method, but How does |
@jonpryor yes this is the main goal (for XamainVS is the JDK installed by willow for example), this name is ok for me. |
- VisualStudio needs to know this list to set the default jdk on the android settings property page
10c0ed2
to
27d4606
Compare
@jonpryor please see the name change |