Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Peter Collins 1c584c97cf
Fix provider for MonoAndroid target frameworks (#12)
We mistakenly broke this project in commit ab48982d, as an SDK style
fsharp project will not auto glob .fs files when compling.

Fix the project by compiling `ResourceTypeProvider.fs` again, however
this will only work for Classic Xamarin.Android projects.

There are [non-trivial issues][0] that prevent `ResourceTypeProvider.fs`
from running on .NET Core (CodeDom compiling, AppDomain usage, etc).

These are not worth fixing at this time, as an alternate solution has
been provided in https://github.com/fabulousfx/FSharp.Android.Resource.

[0]: https://github.com/xamarin/Xamarin.Android.FSharp.ResourceProvider/issues/11#issuecomment-1028793264
2022-06-24 11:55:45 -04:00
Jonathan Peppers ab48982d15
[build] support for .NET 5.0+ (#6)
Trying to build an F# project under .NET 5 fails with:

    error FS3053 : The type provider 'Xamarin.Android.FSharp.ResourceProvider' reported an error : The type provider constructor has thrown an exception: Could not load file or assembly 'System.CodeDom, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

We need this library to target `netstandard2.0`, so it will work on
.NET framework, Mono, and .NET Core (.NET 5+). I reworked
`Xamarin.Android.FSharp.ResourceProvider.fsproj` to be
`netstandard2.0`.

This created a new issue when I tried to *use* the package in a .NET 5
project:

    Foo.Android.fsproj : error NU1202: Package Xamarin.Android.FSharp.ResourceProvider 1.0.0.29 is not compatible with net5.0 (net5.0). Package Xamarin.Android.FSharp.ResourceProvider 1.0.0.29 supports:
    Foo.Android.fsproj : error NU1202:   - monoandroid81 (MonoAndroid,Version=v8.1)
    Foo.Android.fsproj : error NU1202:   - netstandard2.0 (.NETStandard,Version=v2.0)

.NET 5.0 seems to prefer `netstandard2.0` over `monoandroid81`, and so
it doesn't know what to do here: hence the error.

I literally, could run this command on the package and it works afterward:

    zip -d Xamarin.Android.FSharp.ResourceProvider.1.0.0.29.nupkg lib/netstandard2.0/Xamarin.Android.Fsharp.ResourceProvider.dll

The fix is to use the `.nuspec` instead of the `.fsproj`:

    -nuget pack Xamarin.Android.FSharp.ResourceProvider.fsproj
    +nuget pack Xamarin.Android.FSharp.ResourceProvider.nuspec

I also made some changes to the Xamarin.Android project (just general
cleanup):

* Migrate from `packages.config` to `@(PackageReference)`
* We can rely on `/restore` now in the build definition.
  `restoreNugetPackages` is deprecated, so we shouldn't use it.
* Removed an `<Import/>` that was unused.
2020-08-21 10:53:09 -05:00
nosami d673111b8c Revert the usage of the TP SDK. We need real C# types...
...to be embedded into the F# assembly - not mirrored types

Re https://github.com/xamarin/xamarin-android/issues/1513
and https://github.com/mono/monodevelop/issues/4456

Bump to 1.0.0.22

We also need code such as the following adding to the NUnit template and
possibly others.

```fs
namespace fsandroidnunit
// the name of the type here needs to match the name inside the ResourceDesigner attribute
type Resources = fsandroidnunit.Resource
[<assembly: Android.Runtime.ResourceDesigner("fsandroidnunit.Resources", IsApplication=true)>]
()
```
2018-04-06 16:09:34 +01:00
nosami f7d19797a9 Fix project file 2017-10-24 15:08:22 +01:00
nosami 9c6aaca4bd Update type provider to use SDK 2017-10-24 15:01:11 +01:00
nosami 73ef29db9e Bump to 1.0.0.15 2017-10-13 21:05:17 +01:00
nosami 0724d70aba A better way to get the root namespace 2017-06-27 16:10:22 +01:00
nosami 9ee58e0aae Reference NuGet FSharp.Core 2016-09-29 21:05:02 +01:00
nosami 0fe9ec8878 Switch resources file extension to C# and add default 2016-09-26 16:35:20 +01:00
nosami 76e0f89a31 Add files 2016-09-24 16:06:08 +01:00