-
Notifications
You must be signed in to change notification settings - Fork 564
[F#] Use C# Resource.designer.cs file for F# [C10 MERGE ONLY] #238
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
|
I created a build lane for XS with the new templates. The overall experience looks like this :- |
500d009 to
ae3bdc4
Compare
|
Does this work in both IDEs, Xamarin Studio and Visual Studio? |
| </CreateItem> | ||
|
|
||
| <CreateProperty Value="@(_AndroidResgenFilenameItems->'%(Filename)%(Extension)')"> | ||
| <CreateProperty Value="@(_AndroidResgenFilenameItems->'%(Filename).%(Extension)')"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The %(Extension) already contains the . :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accident :)
|
It's not working when deployed right now. I have definitely seen it working though, currently trying to figure out why. |
|
@jonpryor I haven't tested VS yet, but I expect it to work |
Removes the use of F# CodeDOM for generating the resource designer file for F#. Instead, a [type provider](https://github.com/xamarin/Xamarin.Android.FSharp.ResourceProvider/blob/master/ResourceTypeProvider.fs) is used at compile time (both xbuild and the IDE) that compiles the C# code using CSharpCodeProvider and makes the types available to the consuming F# project. The type provider is available as a NuGet package and is included in the Android templates.
ae3bdc4 to
ad15b93
Compare
|
This PR can be considered for clean up purposes only. It doesn't seem to actually be required. You can test the new F# template here https://github.com/nosami/android-template-test |
|
We have decided not the merge these changes until the new template has been published. That way we don't break existing users. We'll merge this in C10 |
|
Now that we have branched cycle9, maybe this can be merged? It would be no rush though. |
|
Can this make an assembly with the constants that is added to the reference assemblies that get passe don the compiler. That would allow me to use the same constants file for projects written with my custom compiler. I currently have to hack the resource file generating code to support my language as well. |
|
The current situation while hacking the build tasks to sneak in support for another language is terrible on Linux. The build system is a mine field with signing failing because CSC is still depending on Windows parts like mscoree.dll. |
|
Hello! I'm the build bot for the Mono project. I need approval from a Mono team member to build this pull request. A team member should reply with "approve" to approve a build of this pull request, "whitelist" to whitelist this and all future pull requests from this contributor, or "build" to explicitly request a build, even if one has already been done. Contributors can ignore this message. |
1 similar comment
|
Hello! I'm the build bot for the Mono project. I need approval from a Mono team member to build this pull request. A team member should reply with "approve" to approve a build of this pull request, "whitelist" to whitelist this and all future pull requests from this contributor, or "build" to explicitly request a build, even if one has already been done. Contributors can ignore this message. |
Appease Gendarme's [UseCorrectDisposeSignaturesRule][0] logic: [0]: https://github.com/spouliot/gendarme/wiki/Gendarme.Rules.Design.UseCorrectDisposeSignaturesRule(2.10) Gendarme doesn't like `Dispose()` overloads except those which implement the `IDisposable` pattern. Meaning, specifically, Gendarme doesn't like `JniRuntime.JniValueManager.Dispose(IJavaPeerable)`. Rename `JniRuntime.JniValueManager.Dispose(IJavaPeerable)` to `JniRuntime.JniValueManager.DisposePeer(IJavaPeerable)`, and then for consistency rename many of the other `JniRuntime.JniValueManager` methods to likewise have a `Peer` suffix. * `Add(IJavaPeerable)` becomes `AddPeer(IJavaPeerable)` * `Collect()` becomes `CollectPeers()` * `Construct(IJavaPeerable)` becomes `ConstructPeer(IJavaPeerable)` * `Dispose(IJavaPeerable)` becomes `DisposePeer(IJavaPeerable)` * `DisposeUnlessReferenced(IJavaPeerable)` becomes `DisposePeerUnlessReferenced(IJavaPeerable)` * `Finalize(IJavaPeerable)` becomes `FinalizePeer(IJavaPeerable)` * `Remove(IJavaPeerable)` becomes `RemovePeer(IJavaPeerable)`
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>


Removes the use of F# CodeDOM for generating the resource
designer file for F#.
Instead, a type provider
is used at compile time (both xbuild and the IDE) that compiles the
C# code using CSharpCodeProvider and makes the types available to
the consuming F# project. The type provider is available as a NuGet
package and is included in the Android templates.
This is similar to #159, but uses an F# type provider to compile the C# instead of an msbuild task. The advantage of this method is that intellisense works in the IDE without having to change the IDE code.