Skip to content

Conversation

@almostchristian
Copy link

  • Added source generation package Microsoft.Health.Fhir.CodeGeneration.
  • Updates shared libraries to multitarget netstandard2.0 which is required for source generators

Usage:

[GeneratedFhir("Models/Pokemon.StructureDefinition.json",
   TerminologyResources = new[] { "Models/PokemonType.CodeSystem.json", "Models/PokemonType.ValueSet.json" })]
public partial class Pokemon
{
}

Currently the FhirVersionInfo used for code generation is hard-coded to R4B, and I don't see any difference when it's R5.

Resolves #140

@ewoutkramer
Copy link
Contributor

@GinoCanessa - Hadn't seen this PR before, but I guess this needs to change quite a bit after the refactoring of the codegen to use StructureDefinition instead of the custom metadata structures....

@almostchristian
Copy link
Author

Most of my code changes is related to multitargeting to netstandard2.0 which is a requirement for source generators. But from what I saw from the experimental branch, this will not be simple.

@GinoCanessa
Copy link
Contributor

Hi Christian - it is on my list to re-review everything. I started looking into it yesterday and will be making sure your use case is not left out.

@GinoCanessa
Copy link
Contributor

GinoCanessa commented Jul 11, 2024

Alright @almostchristian , the current contents of the experimental branch should have all libraries correctly multi-targeting both .Net 8 and NetStandard 2.0. Note that you need a C# 12.0-compatible compiler to build them*. Please test and let me know if there are any issues.

*After we merge into main, I will finish sorting out the pipeline to release on NuGet as libraries and the CLI as a tool, so the build requirements are only until then.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Source generation for custom resources

4 participants