diff --git a/.external b/.external index 07641ea8d5b..feb40eb697c 100644 --- a/.external +++ b/.external @@ -1,2 +1,2 @@ -xamarin/monodroid:master@5784a746112babd9ef801e0a6bc3fe2694bdf64c +xamarin/monodroid:master@b12a3e8d57a5bdbdc8e829b8f2de80f3cf51e89f mono/mono:2020-02@83105ba22461455f4343d6bb14976eba8b0b3f39 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 c64827e4543..f03d6ac430b 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 @@ -18,21 +18,23 @@ public class AndroidDependenciesTests : BaseTest public void InstallAndroidDependenciesTest () { AssertCommercialBuild (); - if (IsWindows) { - // TODO: we need: https://github.com/xamarin/android-sdk-installer/pull/450 - Assert.Ignore ("InstallAndroidDependencies currently fails on Windows"); - } var old = Environment.GetEnvironmentVariable ("ANDROID_SDK_PATH"); 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); var proj = new XamarinAndroidApplicationProject (); using (var b = CreateApkBuilder ()) { + b.CleanupAfterSuccessfulBuild = false; string defaultTarget = b.Target; b.Target = "InstallAndroidDependencies"; Assert.IsTrue (b.Build (proj, parameters: new string [] { "AcceptAndroidSDKLicenses=true" }), "InstallAndroidDependencies should have succeeded."); b.Target = defaultTarget; - Assert.IsTrue (b.Build (proj), "build should have succeeded."); + 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."); + Assert.IsTrue (b.LastBuildOutput.ContainsText ($"JavaPlatformJarPath={sdkPath}"), "JavaPlatformJarPath did not contain new SDK path."); } } finally { Environment.SetEnvironmentVariable ("ANDROID_SDK_PATH", old);