Open haritowa opened 8 years ago
I see that the fork creates a separate project which specifically targets Xamarin.Mac. As far as I know, it's not currently possible to build a project targeting Xamarin.Mac on Windows.
I think that libraries targeting .NET Framework 4.5 will probably work on Xamarin.Mac. So what I'd like to try is to just compile the library for .NET Framework with the code that uses the correct path for LocalStorage, and see if it can be used from Xamarin.Mac.
Would you be willing to see if this works and send a PR for it?
Sorry for delay, i was rly busy this weekend. As temporary solution, i use PCLStorage, PCLStorage.Abstractions & PCLStorage.FileSystem.Desktop source code in xamarin.mac project:
with some changes(just remove #if derectives & use Filesystem || MAC || Portable code version), for example & it works perfectly
static IFileSystem CreateFileSystem()
{
return new DesktopFileSystem();
}
My mac project use Xamarin.Mac Mobile as Target Framework, not Xamarin.Mac .Net 4.5
I can try to build everything u want on mac, if it'll help you :smile:
I'm now getting this error with the LocalStorage on mac. Are there plans to implement a solution in the main branch and publishing an updated version? Thanks.
So what do you think? Can we get this fixed soon?
Thanks
@Sparksteam Still using workaround ¯(ツ)/¯
@haritowa Hope not too much longer.
@Sparksteam we have switched to native, so this doesn't make me suffer any more :joy:
You can use source from this fork
Thanks @haritowa, I may have to use that fork eventually. Did you build a binding class for OS X, or are you going native across-the-board?
@Sparksteam fully native both for iOS & OS X
To be able to produce a package with Mac support, I need a way to be able to build a library that can run on Xamarin.Mac on a Windows machine. Possible ways of doing this include:
Why would it need to run on Windows? Is there bait-and-switch going on in the NuGet?
@Sparksteam It doesn't need to run on Windows, but I need to be able to build it on Windows. I don't own a Mac, so I can't use one to build the library for Xamarin.Mac. Even if I did, I would strongly prefer to enable everything to be built on a single machine, instead of having to build some of the files on Windows, some on a Mac, and then copying them together and creating a NuGet package out of them.
@Sparksteam And yes, PCL Storage is a canonical example of bait-and-switch. The NuGet package contains a portable "reference assembly" that PCLs can compile against, and then implementations compiled for each platform supported.
Yeah Daniel, it is somewhat cumbersome. And expensive to buy a MAC. I’d be more than happy to build binaries for you and upload them somewhere.
Allan
From: Daniel Plaisted [mailto:notifications@github.com] Sent: Thursday, March 17, 2016 4:12 PM To: dsplaisted/PCLStorage PCLStorage@noreply.github.com Cc: Sparksteam achin5957@hotmail.com Subject: Re: [PCLStorage] Xamarin.Mac support (#28)
@Sparksteam https://github.com/Sparksteam It doesn't need to run on Windows, but I need to be able to build it on Windows. I don't own a Mac, so I can't use one to build the library for Xamarin.Mac. Even if I did, I would strongly prefer to enable everything to be built on a single machine, instead of having to build some of the files on Windows, some on a Mac, and then copying them together and creating a NuGet package out of them.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/dsplaisted/PCLStorage/issues/28#issuecomment-198123575 https://github.com/notifications/beacon/AL--vEEDUozYGk7Eubgik-lNiMP4KSnLks5pud_cgaJpZM4G1ges.gif
@haritowa - Is this only change you had to make to the master code, in DesktopFileSystem.LocalStorage?
var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var localAppData = Path.Combine(documents, "Library");
and adding the necessary MAC preprocessor symbol, of course.
Thanks
@Sparksteam unfortunately, i can't remember all details, i just remove all #IF sections for other platforms :)
PCLStorage.Mac.zip @Sparksteam Try this
Thanks @haritowa . I diff'd the files with the current master and although there were some differences, it doesn't look like any of them contain any MAC specific changes. The one change I referenced last week in your DesktopFileSystem.LocalStorage might be all that's required. I will give that a try and let you know.
@haritowa - I worked around this problem in my code by simply implementing my own GetStorageFolder with this code;
IFolder storageFolder;
var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var localAppData = documents + "/Library"; storageFolder = await FileSystem.Current.GetFolderFromPathAsync(localAppData);
storageFolder = FileSystem.Current.LocalStorage;
@dsplaisted - My offer still stands if you'd like me to build some binaries for you. The fix seems simple enough, but you will need that MAC project.
Thanks guys.
@Sparksteam Can you send a PR to add support for building on the Mac? Once we have that merged then you can build the Mac DLL and send it to me.
Thanks, Daniel
Ok Daniel - PR #38 with the changes I think are required. I'm not sure how to go about testing it though. I have all the release binaries for PCLStorage.OSX. Let me know how you would like me to get them to you. If you build and publish a pre-release NuGet package with these changes I would be more than happy to test it for you.
Thanks,
Allan
ITNOA
Is there any update?
Is it working?
Xamarin.Mac version doesn't work proper way(for example, LocalStorage returns ~/../Library, which incorrect by definition). Here you can find fork, which repairs Mac compatibility