Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Commit 8a5ba32

Browse files
committed
Fix Xamarin.Android SDK locations to match the latest paths.
Now we have: bin/ include/ lib/xamarin.android/lib/xbuild lib/xamarin.android/lib/xbuild/Xamarin/Android (`mandroid` in the past) lib/xamarin.android/lib/xbuild-frameworks/MonoAndroid/v* Version*
1 parent 8ae850f commit 8a5ba32

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

binder/Utils/XamarinAndroid.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ static string GetMonoDroidLibPath()
7373

7474
static readonly Lazy<string[]> targetFrameworks = new Lazy<string[]>(() => new[]
7575
{
76-
Combine(Path, "lib", "xbuild-frameworks", "MonoAndroid", "v1.0"),
77-
Combine(Path, "lib", "xbuild-frameworks", "MonoAndroid", "v1.0", "Facades"),
78-
Combine(Path, "lib", "xbuild-frameworks", "MonoAndroid", TargetFrameworkVersion),
79-
Combine(Path, "lib", "xbuild-frameworks", "MonoAndroid", "v2.3"), //Mono.Android.Export.dll is here
76+
Combine(Path, "lib", "xamarin.android", "xbuild-frameworks", "MonoAndroid", "v1.0"),
77+
Combine(Path, "lib", "xamarin.android", "xbuild-frameworks", "MonoAndroid", "v1.0", "Facades"),
78+
Combine(Path, "lib", "xamarin.android", "xbuild-frameworks", "MonoAndroid", TargetFrameworkVersion),
79+
Combine(Path, "lib", "xamarin.android", "xbuild-frameworks", "MonoAndroid", "v2.3"), //Mono.Android.Export.dll is here
8080
});
8181

8282
public static string[] TargetFrameworkDirectories => targetFrameworks.Value;

binder/Utils/XamarinAndroidBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static class XamarinAndroidBuild
2525
static ProjectRootElement CreateProject()
2626
{
2727
var monoDroidPath = XamarinAndroid.Path;
28-
var msBuildPath = Path.Combine(monoDroidPath, "lib", "xbuild", "Xamarin", "Android");
28+
var msBuildPath = Path.Combine(monoDroidPath, "lib", "xamarin.android", "xbuild", "Xamarin", "Android");
2929
if (!msBuildPath.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.OrdinalIgnoreCase))
3030
msBuildPath = msBuildPath + Path.DirectorySeparatorChar;
3131

external/MonoDroidSdk/MonoDroidSdkBase.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void Initialize (string expectedRuntimePath = null, string binPath = null
5555

5656
RuntimePath = runtimePath;
5757
#pragma warning disable 0618
58-
SdkPath = Path.GetFullPath (Path.Combine (runtimePath, "..", ".."));
58+
SdkPath = Path.GetFullPath (Path.Combine (runtimePath, "..", "..", ".."));
5959
#pragma warning restore 0618
6060
BinPath = binPath;
6161
BclPath = bclPath;
@@ -106,14 +106,13 @@ public void Reset ()
106106
protected static bool ValidateRuntime (string loc)
107107
{
108108
return !string.IsNullOrWhiteSpace (loc) &&
109-
(File.Exists (Path.Combine (loc, DebugRuntime)) || // Normal/expected
110-
File.Exists (Path.Combine (loc, ClassParseExe)) || // Normal/expected
109+
(File.Exists (Path.Combine (loc, ClassParseExe)) || // Normal/expected
111110
File.Exists (Path.Combine (loc, "Xamarin.Android.Common.targets"))); //VS on Windows
112111
}
113112

114113
protected static bool ValidateFramework (string loc)
115114
{
116-
return loc != null && File.Exists (Path.Combine (loc, "mscorlib.dll"));
115+
return loc != null && File.Exists (Path.Combine (loc, "v1.0", "mscorlib.dll"));
117116
}
118117

119118
public string FindVersionFile ()

external/MonoDroidSdk/MonoDroidSdkUnix.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace Xamarin.Android.Tools
88
class MonoDroidSdkUnix : MonoDroidSdkBase
99
{
1010
readonly static string[] RuntimeToFrameworkPaths = new[]{
11-
Path.Combine ("..", "..", "..", ".xamarin.android", "lib", "xbuild-frameworks", "MonoAndroid"),
12-
Path.Combine ("..", "xbuild-frameworks", "MonoAndroid"),
13-
Path.Combine ("..", "mono", "2.1"),
11+
Path.Combine ("..", "..", "..", "..", ".xamarin.android", "lib", "xamarin.android", "xbuild-frameworks", "MonoAndroid"),
12+
Path.Combine ("..", "..", "..", "xbuild-frameworks", "MonoAndroid"),
13+
Path.Combine ("..", "..", "mono", "2.1"),
1414
};
1515

1616
readonly static string[] SearchPaths = {
@@ -24,7 +24,7 @@ protected override string FindRuntime ()
2424
{
2525
string monoAndroidPath = Environment.GetEnvironmentVariable ("MONO_ANDROID_PATH");
2626
if (!string.IsNullOrEmpty (monoAndroidPath)) {
27-
string libMandroid = Path.Combine (monoAndroidPath, "lib", "mandroid");
27+
string libMandroid = Path.Combine (monoAndroidPath, "lib", "xamarin.android", "xbuild", "Xamarin", "Android");
2828
if (Directory.Exists (libMandroid)) {
2929
if (ValidateRuntime (libMandroid))
3030
return libMandroid;
@@ -72,23 +72,23 @@ protected override string FindFramework (string runtimePath)
7272

7373
protected override string FindBin (string runtimePath)
7474
{
75-
string binPath = Path.GetFullPath (Path.Combine (runtimePath, "..", "..", "bin"));
75+
string binPath = Path.GetFullPath (Path.Combine (runtimePath, "..", "..", "..", "..", "..", "bin"));
7676
if (File.Exists (Path.Combine (binPath, GeneratorScript)))
7777
return binPath;
7878
return null;
7979
}
8080

8181
protected override string FindInclude (string runtimePath)
8282
{
83-
string includeDir = Path.GetFullPath (Path.Combine (runtimePath, "..", "..", "include"));
83+
string includeDir = Path.GetFullPath (Path.Combine (runtimePath, "..", "..", "..", "..", "..", "include"));
8484
if (Directory.Exists (includeDir))
8585
return includeDir;
8686
return null;
8787
}
8888

8989
protected override string FindLibraries (string runtimePath)
9090
{
91-
return Path.GetFullPath (Path.Combine (runtimePath, ".."));
91+
return Path.GetFullPath (Path.Combine (runtimePath, "..", "..", "..", ".."));
9292
}
9393

9494
protected override IEnumerable<string> GetVersionFileLocations ()

0 commit comments

Comments
 (0)