[Xamarin.Android.Build.Tests] Fix Framework Path Detection. (#981)

On jenkins is appears we are getting a situation where we
are picking up an empty directory for the FrameworkPath.
As a result we always get 0 when trying to pick up the
runtime that are available. So tests which check the runtimes
fail.

This commit adds a check for a 'libmono-android.release.so' file
so can ensure the required files exist in the folder. Also added
code to pick up the `CONFIGURATION` environment variable from
the Makefile.
This commit is contained in:
Dean Ellis 2017-10-26 16:27:34 +01:00 коммит произвёл Jonathan Pryor
Родитель 462d3730ee
Коммит 8a32e29ae8
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -77,13 +77,21 @@ namespace Xamarin.ProjectTools
get {
if (IsUnix) {
var outdir = Environment.GetEnvironmentVariable ("XA_BUILD_OUTPUT_PATH");
#if DEBUG
var configuraton = Environment.GetEnvironmentVariable ("CONFIGURATION") ?? "Debug";
#else
var configuraton = Environment.GetEnvironmentVariable ("CONFIGURATION") ?? "Release";
#endif
var libmonodroidPath = Path.Combine ("lib", "xamarin.android", "xbuild", "Xamarin", "Android", "lib", "armeabi-v7a", "libmono-android.release.so");
if (String.IsNullOrEmpty(outdir))
outdir = Path.GetFullPath (Path.Combine (Root, "..", "..", "..", "..", "..", "..", "..", "out"));
if (!Directory.Exists (Path.Combine (outdir, "lib")))
if (!Directory.Exists (Path.Combine (outdir, "lib")) || !File.Exists (Path.Combine (outdir, libmonodroidPath)))
outdir = Path.GetFullPath (Path.Combine (Root, "..", "..", "bin", configuraton));
if (!Directory.Exists (Path.Combine (outdir, "lib")) || !File.Exists (Path.Combine (outdir, libmonodroidPath)))
outdir = Path.GetFullPath (Path.Combine (Root, "..", "..", "bin", "Debug"));
if (!Directory.Exists (Path.Combine (outdir, "lib")))
if (!Directory.Exists (Path.Combine (outdir, "lib")) || !File.Exists (Path.Combine (outdir, libmonodroidPath)))
outdir = Path.GetFullPath (Path.Combine (Root, "..", "..", "bin", "Release"));
if (!Directory.Exists (outdir))
if (!Directory.Exists (Path.Combine (outdir, "lib")) || !File.Exists (Path.Combine (outdir, libmonodroidPath)))
outdir = "/Library/Frameworks/Xamarin.Android.framework/Versions/Current";
return Path.Combine (outdir, "lib", "xamarin.android");
}