diff --git a/.gitmodules b/.gitmodules index 8b2fa1df307..42325127a0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -41,4 +41,4 @@ [submodule "external/xamarin-android-tools"] path = external/xamarin-android-tools url = https://github.com/xamarin/xamarin-android-tools - branch = main + branch = jonp-provide-valiation-details diff --git a/external/xamarin-android-tools b/external/xamarin-android-tools index 20f611202be..1ed601dd3bf 160000 --- a/external/xamarin-android-tools +++ b/external/xamarin-android-tools @@ -1 +1 @@ -Subproject commit 20f611202bef0fc7c1659366dd38865eb119dde5 +Subproject commit 1ed601dd3bfecf441a4e16b5b173205dd5aa5eca diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs index a93bdb23536..f599974313c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs @@ -96,6 +96,13 @@ public override bool RunTask () JavaSdkPath = MonoAndroidHelper.GetJdkInfo (this.CreateTaskLogger (), JavaSdkPath, minVersion, maxVersion)?.HomePath; + if (Directory.Exists (AndroidSdkPath)) { + Log.LogDebugMessage ($"# jonp: AndroidSdkPath={AndroidSdkPath}; contents"); + foreach (var p in Directory.EnumerateFileSystemEntries (AndroidSdkPath, "*", SearchOption.AllDirectories)) { + Log.LogDebugMessage ("# jonp: {p}"); + } + } + MonoAndroidHelper.RefreshSupportedVersions (ReferenceAssemblyPaths); try { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs index b3a809fd285..4046a01269c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs @@ -22,23 +22,28 @@ public void InstallAndroidDependenciesTest () // We need to grab the latest API level *before* changing env vars var apiLevel = AndroidSdkResolver.GetMaxInstalledPlatform (); var old = Environment.GetEnvironmentVariable ("ANDROID_SDK_PATH"); + var _configPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "xbuild", "monodroid-config.xml"); + bool haveConfigPath = File.Exists (_configPath); try { string sdkPath = Path.Combine (Root, "temp", TestName, "android-sdk"); Environment.SetEnvironmentVariable ("ANDROID_SDK_PATH", sdkPath); if (Directory.Exists (sdkPath)) Directory.Delete (sdkPath, true); Directory.CreateDirectory (sdkPath); + TestContext.Out.WriteLine ($"[TESTLOG] InstallAndroidDependenciesTest: empty sdkPath size? {string.Join (", ", Directory.EnumerateFileSystemEntries (sdkPath, "*", SearchOption.AllDirectories))}"); var proj = new XamarinAndroidApplicationProject { TargetSdkVersion = apiLevel.ToString (), }; using (var b = CreateApkBuilder ()) { b.CleanupAfterSuccessfulBuild = false; string defaultTarget = b.Target; + TestContext.Out.WriteLine ($"[TESTLOG] InstallAndroidDependenciesTest: before build sdkPath size? {string.Join (", ", Directory.EnumerateFileSystemEntries (sdkPath, "*", SearchOption.AllDirectories))}"); b.Target = "InstallAndroidDependencies"; Assert.IsTrue (b.Build (proj, parameters: new string [] { "AcceptAndroidSDKLicenses=true", "AndroidManifestType=GoogleV2", // Need GoogleV2 so we can install API-32 }), "InstallAndroidDependencies should have succeeded."); + TestContext.Out.WriteLine ($"[TESTLOG] InstallAndroidDependenciesTest: after build sdkPath size? {string.Join (", ", Directory.EnumerateFileSystemEntries (sdkPath, "*", SearchOption.AllDirectories))}"); b.Target = defaultTarget; Assert.IsTrue (b.Build (proj, true), "build should have succeeded."); Assert.IsTrue (b.LastBuildOutput.ContainsText ($"Output Property: _AndroidSdkDirectory={sdkPath}"), "_AndroidSdkDirectory was not set to new SDK path."); @@ -47,6 +52,7 @@ public void InstallAndroidDependenciesTest () } finally { Environment.SetEnvironmentVariable ("ANDROID_SDK_PATH", old); } + throw new Exception ($"# jonp: deliberate test failure! File.Exist(\"{_configPath}\")? {haveConfigPath}"); } [Test]