Retargeting for generative type providers #139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements cross-targeting for generative type providers.
With this PR, a generative type provider now uses a IL binary writer built into the TPSDK (a modified copy of the Abstract IL binary writer) to produce the necessary assembly rather than using Reflection.Emit. This means that the output can match the target binaries of the compilation using the standard translate-to-target technique.
Considerably more testing is needed - this is a new binary writer and is currently only tested by the two small generative type providers in the SDK tests.
You can defined NO_GENERATIVE if you want to reduce the size of a non-generative type provider to remove this functionality.
This should allow generative type providers to target .NET Core, and for generative type providers to be implemented on .NET Core, though in both cases this is still to be tested (it has not been tested at all as yet).