Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 6929c59

Browse files
committed
Fix up Mono.Android.dll path resolution on windows
The install path is different in vs2017 now, since you can have multiple vs2017 installs, so the android reference assemblies aren’t in a common folder under program files any longer.
1 parent 24fda05 commit 6929c59

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build.cake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ class ArtifactInfo
151151
}
152152

153153
var MONODROID_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/" + ANDROID_SDK_VERSION + "/";
154-
if (IsRunningOnWindows ())
155-
MONODROID_PATH = MakeAbsolute (new DirectoryPath (Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86)).Combine ("Reference Assemblies/Microsoft/Framework/MonoAndroid/" + ANDROID_SDK_VERSION +"/")).FullPath;
154+
if (IsRunningOnWindows ()) {
155+
var vsInstallPath = VSWhereLatest (new VSWhereLatestSettings { Requires = "Component.Xamarin" });
156+
MONODROID_PATH = vsInstallPath.Combine ("Common7/IDE/ReferenceAssemblies/Microsoft/Framework/MonoAndroid/" + ANDROID_SDK_VERSION).FullPath;
157+
}
156158

157159
var MSCORLIB_PATH = "/Library/Frameworks/Xamarin.Android.framework/Libraries/mono/2.1/";
158160
if (IsRunningOnWindows ()) {
@@ -165,6 +167,9 @@ if (IsRunningOnWindows ()) {
165167
MSCORLIB_PATH = MakeAbsolute (DOTNETDIR.Combine("Framework/v4.0.30319/")).FullPath;
166168
}
167169

170+
Information ("MONODROID_PATH: {0}", MONODROID_PATH);
171+
Information ("MSCORLIB_PATH: {0}", MSCORLIB_PATH);
172+
168173
var nugetInfos = ARTIFACTS.Select (a => new NuGetInfo { NuSpec = "./" + a.PathPrefix + a.ArtifactId + "/nuget/" + a.NugetId + ".nuspec", Version = a.NuGetVersion, RequireLicenseAcceptance = true }).ToList ();
169174
nugetInfos.Add (new NuGetInfo { NuSpec = "./support-v4/nuget/Xamarin.Android.Support.v4.nuspec", Version = NUGET_VERSION, RequireLicenseAcceptance = true });
170175

0 commit comments

Comments
 (0)