Xamarin.Android.FSharp.Reso.../Runtime
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
..
Resources Add files 2016-09-24 16:06:08 +01:00
AssemblyInfo.fs Don't attempt to filter any referenced assemblies 2018-10-12 17:31:42 +01:00
Provider.fs Update type provider to use SDK 2017-10-24 15:01:11 +01:00
Xamarin.Android.FSharp.ResourceProvider.Runtime.fsproj [build] support for .NET 5.0+ (#6) 2020-08-21 10:53:09 -05:00