Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[6.0] Codegeneration improvements #315

Open
7 of 14 tasks
Daniel-Svensson opened this issue Oct 5, 2021 · 1 comment · Fixed by #414
Open
7 of 14 tasks

[6.0] Codegeneration improvements #315

Daniel-Svensson opened this issue Oct 5, 2021 · 1 comment · Fixed by #414

Comments

@Daniel-Svensson
Copy link
Member

Daniel-Svensson commented Oct 5, 2021

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"

@Daniel-Svensson
Copy link
Member Author

@ehsangfl you might be interested in trying out https://www.nuget.org/packages/OpenRiaServices.Client.CodeGen/5.4.0-tags-v5-4-0-preview-1.1 it can generate code directly against aspnetcore projects.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants