Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIGURATION := Debug
NUNIT_CONSOLE := packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe
NUNIT_CONSOLE := packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe
OS := $(shell uname)
RUNTIME := mono --debug=casts
V ?= 0
Expand All @@ -23,7 +23,7 @@ define RUN_NUNIT_TEST
$(RUNTIME) \
$(NUNIT_CONSOLE) $(NUNIT_EXTRA) $(1) \
$(if $(RUN),-run:$(RUN)) \
--result="TestResult-$(basename $(notdir $(1))).xml;format=nunit2" \
--result="TestResult-$(basename $(notdir $(1))).xml" \
-output=bin/Test$(CONFIGURATION)/TestOutput-$(basename $(notdir $(1))).txt \
|| true ; \
if [ -f "bin/Test$(CONFIGURATION)/TestOutput-$(basename $(notdir $(1))).txt" ] ; then \
Expand Down
17 changes: 17 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<!-- ensure only the sources defined below are used -->
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="dotnet internal feed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" protocolVersion="3" />

<!-- This is needed (currently) for the Xamarin.Android.Deploy.Installer dependency, getting the installer -->
<!-- Android binary, to support delta APK install -->
<add key="xamarin.android util" value="https://pkgs.dev.azure.com/xamarin/public/_packaging/Xamarin.Android/nuget/v3/index.json" />
</packageSources>
<config>
<add key="globalPackagesFolder" value="packages" />
</config>
</configuration>
10 changes: 5 additions & 5 deletions src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ public IEnumerable<string> GetBuildToolsPaths ()
{
var buildTools = Path.Combine (AndroidSdkPath, "build-tools");
if (Directory.Exists (buildTools)) {
var sorted = SortedSubdirectoriesByVersion (buildTools);

foreach (var d in sorted)
yield return d;

var preview = Directory.EnumerateDirectories (buildTools)
.Where(x => TryParseVersion (Path.GetFileName (x)) == null)
.Select(x => x);

foreach (var d in preview)
yield return d;

var sorted = SortedSubdirectoriesByVersion (buildTools);

foreach (var d in sorted)
yield return d;
}
var ptPath = Path.Combine (AndroidSdkPath, "platform-tools");
if (Directory.Exists (ptPath))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,5 +448,30 @@ string UnixConfigPath {
return Path.Combine (UnixConfigDirOverridePath, "monodroid-config.xml");
}
}

[Test]
public void GetBuildToolsPaths_StableVersionsFirst ()
{
CreateSdks (out string root, out string jdk, out string ndk, out string sdk);
CreateFauxAndroidSdkDirectory (sdk, "27.0.0-rc4");

var logs = new StringWriter ();
Action<TraceLevel, string> logger = (level, message) => {
logs.WriteLine ($"[{level}] {message}");
};

try {
var info = new AndroidSdkInfo (logger, androidSdkPath: sdk, androidNdkPath: ndk, javaSdkPath: jdk);

var buildToolsPaths = info.GetBuildToolsPaths ().ToList ();
Assert.AreEqual (3, buildToolsPaths.Count);
Assert.AreEqual (Path.Combine (sdk, "build-tools", "26.0.0"), buildToolsPaths [0]);
Assert.AreEqual (Path.Combine (sdk, "build-tools", "27.0.0-rc4"), buildToolsPaths [1]);
Assert.AreEqual (Path.Combine (sdk, "platform-tools"), buildToolsPaths [2]);
}
finally {
Directory.Delete (root, recursive: true);
}
}
}
}