Skip to content

Commit 936f8dc

Browse files
authored
Context: xamarin/android-sdk-installer@2b4d1a6 Changes: xamarin/monodroid@5784a74...b12a3e8 * xamarin/monodroid@b12a3e8d5: Bump to xamarin/android-sdk-installer@2b4d1a6 & xamarin/xamarin-android/master@d583b7c (#1107) * xamarin/monodroid@3d84feddd: Bump to xamarin/xamarin-android/master@f0d565fe (#1106) * xamarin/monodroid@ec2931825: Bump to xamarin/android-sdk-installer@c6c12db0 (#1105) Sometimes, `<InstallAndroidDependencies/>` would fail when running on Windows, a'la: …\Xamarin\Android\Xamarin.Installer.Common.targets(12,3): Cannot access a disposed object. Object name: 'SslStream'. A fix for the `ObjectDisposedException` has been brought in via the `android-sdk-installer` bump in xamarin/monodroid@b12a3e8d. The `<InstallAndroidDependencies/>` test previously had issues due to clean up logic in the test framework that partially deleted the newly provisioned Android SDK on a subsequent build. I believe that we've been seeing successful results for this test because the subsequent build in the test would fall back to a different Android SDK that was already on disk. The test has been improved by asserting that the newly installed Android SDK is used during the subsequent build.
1 parent 7309784 commit 936f8dc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.external

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
xamarin/monodroid:master@5784a746112babd9ef801e0a6bc3fe2694bdf64c
1+
xamarin/monodroid:master@b12a3e8d57a5bdbdc8e829b8f2de80f3cf51e89f
22
mono/mono:2020-02@83105ba22461455f4343d6bb14976eba8b0b3f39

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,23 @@ public class AndroidDependenciesTests : BaseTest
1818
public void InstallAndroidDependenciesTest ()
1919
{
2020
AssertCommercialBuild ();
21-
if (IsWindows) {
22-
// TODO: we need: https://github.com/xamarin/android-sdk-installer/pull/450
23-
Assert.Ignore ("InstallAndroidDependencies currently fails on Windows");
24-
}
2521
var old = Environment.GetEnvironmentVariable ("ANDROID_SDK_PATH");
2622
try {
2723
string sdkPath = Path.Combine (Root, "temp", TestName, "android-sdk");
2824
Environment.SetEnvironmentVariable ("ANDROID_SDK_PATH", sdkPath);
25+
if (Directory.Exists (sdkPath))
26+
Directory.Delete (sdkPath, true);
27+
Directory.CreateDirectory (sdkPath);
2928
var proj = new XamarinAndroidApplicationProject ();
3029
using (var b = CreateApkBuilder ()) {
30+
b.CleanupAfterSuccessfulBuild = false;
3131
string defaultTarget = b.Target;
3232
b.Target = "InstallAndroidDependencies";
3333
Assert.IsTrue (b.Build (proj, parameters: new string [] { "AcceptAndroidSDKLicenses=true" }), "InstallAndroidDependencies should have succeeded.");
3434
b.Target = defaultTarget;
35-
Assert.IsTrue (b.Build (proj), "build should have succeeded.");
35+
Assert.IsTrue (b.Build (proj, true), "build should have succeeded.");
36+
Assert.IsTrue (b.LastBuildOutput.ContainsText ($"Output Property: _AndroidSdkDirectory={sdkPath}"), "_AndroidSdkDirectory was not set to new SDK path.");
37+
Assert.IsTrue (b.LastBuildOutput.ContainsText ($"JavaPlatformJarPath={sdkPath}"), "JavaPlatformJarPath did not contain new SDK path.");
3638
}
3739
} finally {
3840
Environment.SetEnvironmentVariable ("ANDROID_SDK_PATH", old);

0 commit comments

Comments
 (0)