-
Notifications
You must be signed in to change notification settings - Fork 564
[Xamarin.Android.Build.Tasks] Fixed F# Resource Designer compilation issues [DONT MERGE] #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Personally, if this works as we expect, I think we should move ALL project types over to using the |
a1cb860 to
a9647c5
Compare
|
The problem with this so far is the C# code is generated in Resource.Designer.fs . |
a9647c5 to
3e3a326
Compare
|
I know this isn't finished yet, but just reporting my findings.
This causes a warning in the editor before build I also get two red squiggles in the editor Would it be possible to include After building (and making a random edit) everything looks fine :- "Bug 42840 Unable to build F# Android project with F# Class Library." is fixed by this change. I wasn't able to test the mixed F#/C# solution bugs, because this PR breaks C# :) But I would expect them to just work. |
3e3a326 to
585ab90
Compare
…issues The latest release of F# removed support for static fields. As a result the Resource.Designer.fs file that wes being generated by our build system no longer compiled. This commit reworks the Designer.cs code to emit a C# assembly for F# projects rather than just the code. This has the benifit of us not having to produce F# code in the first place. The new system works as follows. 1) GenerateResourceDesigner Task generates a Resources.Designer.cs file as normal 2) If the target project is F# that file is then compiled into a Resource.Designer.dll 3) The new .dll is then included in the @ReferencePaths ItemGroup 4) The Resource.Designer.cs is removed from the @complie ItemGroup If the project is C# or VS the Designer file is just included as normal.
585ab90 to
f91700b
Compare
|
@nosami, @dellis1972: what's the status of this PR? Should we merge this for XA 7.2? Does it need testing, QA? What are the QA implications of this PR? |
Without this, abstract classes that implement `java.time.chrono.Chronology` fail to bind because they will try to implement those static properties as instance (this check had been done for methods, but not for properties).
Context: #238 Context: #4132 Removes the use of F# CodeDOM for generating the resource designer file for F#. Instead, the [Xamarin.Android.FSharp.ResourceProvider][0] type provider will be used at compile time -- via both `msbuild` and the IDE -- which will compile the C# `Resource.Designer.cs` file and make the types available to the consuming F# project. The type provider is available as a [NuGet package][1] and is included in the Android templates. This is conceptually similar to [PR #159][2], but uses an F# type provider to compile the C# code instead of an MSBuild task. The advantage of this method is that IntelliSense works within the IDE without needing to change the IDE code. [0]: https://github.com/xamarin/Xamarin.Android.FSharp.ResourceProvider [1]: https://www.nuget.org/packages/Xamarin.Android.FSharp.ResourceProvider [2]: #159 Co-authored-by: Jason Imison <nosami@users.noreply.github.com>
Changes: dotnet/android-tools@f4c44e2...fc3c2ac * dotnet/android-tools@fc3c2ac: Bump to Microsoft.VisualStudioEng.MicroBuild.Core 1.0.0 (dotnet#159)
Changes: dotnet/android-tools@f4c44e2...fc3c2ac * dotnet/android-tools@fc3c2ac: Bump to Microsoft.VisualStudioEng.MicroBuild.Core 1.0.0 (#159)



The latest release of F# removed support for static fields. As a result
the Resource.Designer.fs file that wes being generated by our build
system no longer compiled.
This commit reworks the Designer.cs code to emit a C# assembly for
F# projects rather than just the code. This has the benifit of
us not having to produce F# code in the first place.
The new system works as follows.
If the project is C# or VS the Designer file is just included as normal.