Commit 5552b07
authored
[Xamarin.Android.Tools.AndroidSdk] Improve utility of JDK warnings (#87)
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.1 parent 13cc497 commit 5552b07
File tree
2 files changed
+2
-2
lines changed- src/Xamarin.Android.Tools.AndroidSdk
- Sdks
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments