Skip to content

Conversation

@jonpryor
Copy link
Contributor

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

Trying to figure out how xamarin-android's
AndroidDependenciesTests.InstallAndroidDependenciesTest() passes;
it creates an empty "SDK" directory, then builds with the
InstallAndroidDependencies target, and on main this works,
even though it implies that it's creating an AndroidSdkInfo
instance with an empty SDK directory:

if (Directory.Exists (sdkPath))
	Directory.Delete (sdkPath, true);
Directory.CreateDirectory (sdkPath);
// `sdkPath` is not otherwise populated

Yet it passes ValidateAndroidSdkLocation():

  ValidateAndroidSdkLocation: `/Users/runner/work/1/a/TestRelease/06-09_22.00.22/temp/InstallAndroidDependenciesTest/android-sdk`, result=True

I do not understand how this can be the case, as
ValidateAndroidSdkLocation() wants a platform-tools/adb program,
which should not exist, yet it validates

I am thus very confused.

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.

This way, hopefully, I can verify that it is finding an adb,
and where that file is located.

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

Trying to figure out how xamarin-android's
`AndroidDependenciesTests.InstallAndroidDependenciesTest()` *passes*;
it creates an empty "SDK" directory, then builds with the
`InstallAndroidDependencies` target, and on main this works,
*even though* it implies that it's creating an `AndroidSdkInfo`
instance with an *empty* SDK directory:

	if (Directory.Exists (sdkPath))
		Directory.Delete (sdkPath, true);
	Directory.CreateDirectory (sdkPath);
	// `sdkPath` is not otherwise populated

Yet it *passes* `ValidateAndroidSdkLocation()`:

	  ValidateAndroidSdkLocation: `/Users/runner/work/1/a/TestRelease/06-09_22.00.22/temp/InstallAndroidDependenciesTest/android-sdk`, result=True

I do not understand *how* this can be the case, as
`ValidateAndroidSdkLocation()` wants a `platform-tools/adb` program,
*which should not exist*, yet it validates

I am thus very confused.

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.

This way, hopefully, I can verify that it *is* finding an `adb`,
and *where that file is located*.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants