Skip to content

Commit

Permalink
fix: fix the mac directories (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson authored Jun 14, 2019
1 parent e8f09a4 commit a9576d4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/Pharmacist.Core/Extractors/PlatformExtractors/Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace Pharmacist.Core.Extractors.PlatformExtractors
Expand All @@ -25,6 +26,11 @@ public class Android : BasePlatform
/// <inheritdoc />
public override Task Extract(string referenceAssembliesLocation)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
referenceAssembliesLocation = "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild-frameworks";
}

// Pin to a particular framework version https://github.com/reactiveui/ReactiveUI/issues/1517
var latestVersion = Directory.GetFiles(
Path.Combine(referenceAssembliesLocation, "MonoAndroid"),
Expand Down
6 changes: 6 additions & 0 deletions src/Pharmacist.Core/Extractors/PlatformExtractors/Mac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace Pharmacist.Core.Extractors.PlatformExtractors
Expand All @@ -20,6 +21,11 @@ public class Mac : BasePlatform
/// <inheritdoc />
public override Task Extract(string referenceAssembliesLocation)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
referenceAssembliesLocation = "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/";
}

var assemblies =
Directory.GetFiles(
Path.Combine(referenceAssembliesLocation, "Xamarin.Mac"),
Expand Down
6 changes: 6 additions & 0 deletions src/Pharmacist.Core/Extractors/PlatformExtractors/iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace Pharmacist.Core.Extractors.PlatformExtractors
Expand All @@ -23,6 +24,11 @@ public class iOS : BasePlatform
/// <inheritdoc />
public override Task Extract(string referenceAssembliesLocation)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
referenceAssembliesLocation = "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/";
}

var assemblies =
Directory.GetFiles(
Path.Combine(referenceAssembliesLocation, "Xamarin.iOS"),
Expand Down
2 changes: 1 addition & 1 deletion src/Pharmacist.Core/Extractors/PlatformExtractors/tvOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override Task Extract(string referenceAssembliesLocation)
{
if (PlatformHelper.IsRunningOnMono())
{
referenceAssembliesLocation = Path.Combine(referenceAssembliesLocation, "Xamarin.iOS.framework/Versions/Current/lib/mono");
referenceAssembliesLocation = "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/";
}

var assemblies =
Expand Down
2 changes: 1 addition & 1 deletion src/Pharmacist.Core/ReferenceLocators/ReferenceLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static Task<string> GetReferenceLocation(bool includePreRelease = true)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return Task.FromResult("/Library⁩/Frameworks⁩/Libraries/⁨mono");
return Task.FromResult("/Library⁩/Frameworks⁩/Libraries/⁨mono");
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
Expand Down

0 comments on commit a9576d4

Please sign in to comment.