Skip to content
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

Replace PowerShell codegen with C# #656

Merged
merged 27 commits into from
May 1, 2019
Merged

Conversation

angularsen
Copy link
Owner

@angularsen angularsen commented Apr 18, 2019

Fixes #522 .

I've looked into some alternatives in #522 and found that plain old C# should do they job just nicely.

  • Microsoft's new & upcoming command line parser
  • dotnet run support
  • dotnet-suggest support (experimental via DragonFruit package, but Summer Is Coming)
  • Fast
  • Easy to debug
  • Strongly typed
  • All your C# tools for intellisense, refactoring, code analysis etc works

The only downside I can think of is a slightly more cumbersome syntax, but it's really not much and tried to mitigate that with some helper methods.

Changes

  • Add new /CodeGen .NET Core 2.1 console app
  • Remove old PowerShell scripts
  • Update build scripts

The new codegen produces pretty much identical output, except for a few whitespace improvements.

See the README for more info.

@angularsen angularsen requested a review from tmilnthorp April 18, 2019 03:10
@angularsen
Copy link
Owner Author

Updated the WRC scripts too.

@tmilnthorp
Copy link
Collaborator

Looks good to me! I'll have to pull the code and play with it when I get come time.

angularsen added 4 commits May 1, 2019 14:28
Merge conflict had to be ported from PowerShell to C#.
UnitAbbreviationsCache now gets single entries with string arrays instead of multiple entries with single item arrays.
This is an improvement, but should be functionally equivalent.
@angularsen
Copy link
Owner Author

Thanks, I'll merge this now and we can always refine it later.

@angularsen angularsen merged commit 8ff6e7b into master May 1, 2019
@angularsen angularsen deleted the new/522-codegen-with-csharp branch May 1, 2019 15:05
@angularsen
Copy link
Owner Author

vKaras1337 added a commit to vKaras1337/UnitsNet that referenced this pull request Jun 28, 2023
…eGen change?

can't find it because it looks like that this line changes has been excluded from commits from atleast  (angularsen#656)
angularsen pushed a commit to vKaras1337/UnitsNet that referenced this pull request Jul 11, 2023
…eGen change?

can't find it because it looks like that this line changes has been excluded from commits from atleast  (angularsen#656)
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.

Look into alternatives to code generators
2 participants