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

[Xamarin.Android.Tools.AndroidSdk] Improve utility of JDK warnings #87

Merged
merged 1 commit into from
Jun 4, 2020

Commits on Jun 4, 2020

  1. [Xamarin.Android.Tools.AndroidSdk] Improve utility of JDK warnings

    Context: dotnet/android#4567
    Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3781637&view=logs&j=aacb7678-d5ef-5d73-dd2c-3def32e966f3&t=36563657-e889-567e-4d1d-090ca934735a
    
    We're trying to get our CI to use JDK11 (dotnet/android#4567),
    for which we added support for a `JI_JAVA_HOME` environment variable
    "override"; see 13cc497.
    
    However, even with `JI_JAVA_HOME` set, `nuget restore` still fails:
    
    	…\Xamarin.Android.Tooling.targets(65,5): warning XA5300: Not a valid JDK directory: `C:\Users\dlab14\android-toolchain\jdk`; via locator: $JI_JAVA_HOME
    
    The question is *why* it's an invalid JDK directory.  (It certainly
    looks like it should be valid!)
    
    While we *do* print out the contents of `e.ToString()`, this is only
    written as "verbose" output, which isn't captured by `nuget restore`.
    As such, we have no idea why the JDK directory is not considered valid.
    
    Update the warning message that Java.Interop emits when checking JDK
    locations so that it includes `Exception.Message`, e.g.
    
    	The directory `/invalid`, via locator `$JI_JAVA_HOME`, is not a valid JDK directory: Not a directory
    
    This will hopefully provide enough detail to let us know why it's
    failing.
    jonpryor committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    718c6a2 View commit details
    Browse the repository at this point in the history