Skip to content

[6.0] Codegeneration improvements #315

@Daniel-Svensson

Description

@Daniel-Svensson

High level goals for code generation

A working sample can be found in Samples repo

Codegen remaining work

  • Add test similar to CreateRiaClientFiles_ASPNET_AppDomain for net6 link
    • We want a test which verifies that Program.SetupAppConfig in codegeneration program works as expected
  • Add dependencies from Tools and Tools.TextTemplate in T4.nuspec link
  • Create ServerClassLibNet6 by copying ServerClassLib link
  • Fix insecurity with Path.GetTempFile()
  • Implement or take action on server codegen validation
  • Support nullable reference types (it generates attributes on client which gives Compile errors).
    • see nullable attributes metadata which needs to be "reversed/decompiled" to corresponding c#/vb code
    • a good temporary solution could be to ignore properties in code gen
  • Support "required" properties (it generates an attribute on client which gives Compile errors)
  • Support other new property features (if any) that are implemented as attributes that are not allowed to be specified in code ("init" properties?)

New codegen exe todo's:

Program.cs

  • // TODO: Remove dependency on MSBuild and then remove any PackageReferences to MSBuild and MSBuildLocator
    - This will require splitting "OpenRiaServices.Tools" into 2 separate projects, one with MSbuild tasks and one without (just code generation)

SharedCodeServiceParametersBinder.cs

  • Change parameter names to match "default/recommended" names such as "--shared-source-files"
    This might make the binders redundant and maybe allows some further cleanup of the program
    // TODO:

  • Change name of project (and exe) , from "Tools.CodeGen" to something else such as "Tools.Console"

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions