-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Tools.AndroidSdk] AndroidSdkInfo validation locator (#…
…170) Context: dotnet/android#7073 Context: https://github.com/xamarin/xamarin-android/blob/fdfc4c44ba65fcff9caf809bcf2d1f1a6837b1e3/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs#L19-L50 I was trying to figure out how xamarin-android's `AndroidDependenciesTests.InstallAndroidDependenciesTest()` *passes*; the test creates an empty "SDK" directory, then builds with the `InstallAndroidDependencies` target, then builds the `Build` target, then asserts that the used SDK directory matches the "temp" directory. The cause of the confusion was twofold: 1. Two targets were run, but they both wrote to the same log file, and thus any output from the `InstallAndroidDependencies` target was *lost*, which meant 2. When reviewing the output of the `Build` target -- the *only* output for quite some time -- I started searching for "other possibilities" for why it would work, e.g. "it's not using the constructor parameter, but rather `monodroid-config.xml`", which needed to be separately investigated and discarded. The investigation is done -- the problems were that the log file needed to understand what was going wrong didn't exist, and that the `platform-tools` 32.0.0 package didn't exist in the GoogleV2 manifest, and thus `platform-tools` wasn't installed, and thus `adb` wasn't found, causing `ValidateAndroidSdkLocation()` to skip it -- but the additional contextual log information could be useful for future investigations. Expand the log messages provided by `AndroidSdkBase` & co. so that we also log "where" the `loc` parameter is coming from, via a new `locator` parameter (similar to the `locator` parameter in `JdkInfo`), and update the "file check" logic so that we log the path of the detected files.
- Loading branch information
Showing
3 changed files
with
37 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters