-
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] Probe for Microsoft OpenJDK dirs (#…
…113) Context: https://aka.ms/getopenjdk Context: https://devblogs.microsoft.com/java Remove support for the obsolete (and never updated) `microsoft_dist_openjdk_*` builds of OpenJDK. Despite having "microsoft" in the name, it was maintained by a different team which has moved on to other things.
- Loading branch information
Showing
7 changed files
with
265 additions
and
30 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
10 changes: 10 additions & 0 deletions
10
src/Xamarin.Android.Tools.AndroidSdk/Properties/AssemblyInfo.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo ( | ||
"Xamarin.Android.Tools.AndroidSdk-Tests, PublicKey=" + | ||
"0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf1" + | ||
"6cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2" + | ||
"814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0" + | ||
"d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b" + | ||
"2c9733db" | ||
)] |
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
68 changes: 68 additions & 0 deletions
68
tests/Xamarin.Android.Tools.AndroidSdk-Tests/AndroidSdkWindowsTests.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Xml.Linq; | ||
|
||
using NUnit.Framework; | ||
|
||
namespace Xamarin.Android.Tools.Tests | ||
{ | ||
[TestFixture] | ||
public class AndroidSdkWindowsTests | ||
{ | ||
[Test] | ||
public void ExtractVersion () | ||
{ | ||
var sep = Path.DirectorySeparatorChar; | ||
|
||
var tests = new[]{ | ||
new { | ||
Path = $"foo{sep}", | ||
Prefix = "", | ||
Expected = (Version) null, | ||
}, | ||
new { | ||
Path = $"foo{sep}bar-1-extra", | ||
Prefix = "bar-", | ||
Expected = (Version) null, | ||
}, | ||
new { | ||
Path = $"foo{sep}abcdef", | ||
Prefix = "a", | ||
Expected = (Version) null, | ||
}, | ||
new { | ||
Path = $"foo{sep}a{sep}b.c.d", | ||
Prefix = "none-of-the-above", | ||
Expected = (Version) null, | ||
}, | ||
new { | ||
Path = $"jdks{sep}jdk-1.2.3-hotspot-extra", | ||
Prefix = "jdk-", | ||
Expected = new Version (1, 2, 3), | ||
}, | ||
new { | ||
Path = $"jdks{sep}jdk-1.2.3-hotspot-extra", | ||
Prefix = "jdk", | ||
Expected = new Version (1, 2, 3), | ||
}, | ||
new { | ||
Path = $"jdks{sep}jdk-1.2.3.4.5.6-extra", | ||
Prefix = "jdk-", | ||
Expected = new Version (1, 2, 3, 4), | ||
}, | ||
}; | ||
|
||
foreach (var test in tests) { | ||
Assert.AreEqual ( | ||
test.Expected, | ||
AndroidSdkWindows.ExtractVersion (test.Path, test.Prefix), | ||
$"Version couldn't be extracted from Path=`{test.Path}` Prefix=`{test.Prefix}`!" | ||
); | ||
} | ||
} | ||
} | ||
} |
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