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

Edit to allow core and framework targets on the same build #20233

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

BryanAldrich
Copy link
Contributor

When building for net framework and netcore, the csharp doesn't properly compile. e.g. references to DateOnly for the net472 build is what brought this to my attention.

I changed the mustache directives for net6 to be compiler directives instead. Due to new line requirements on the directives, this did require some symantical formatting changes. Other changes I removed entirely to keep the mustache logic a lot simpler. (e.g. the new () vs new Class() syntax).

@mandrean @shibayan @Blackclaws @lucamazzanti @iBicha

The notes below say for windows to run it in Git Bash, however, all of the line endings are messed up, I re-ran it in WSL so it is all proper linux endings.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@BryanAldrich BryanAldrich force-pushed the EditToAllowCoreAndFrameworkTargets branch from c8af701 to 88158f7 Compare December 4, 2024 03:07
@wing328
Copy link
Member

wing328 commented Dec 5, 2024

cc @devhl-labs as well since the change impacts generichost

@wing328
Copy link
Member

wing328 commented Dec 5, 2024

the CI builds still failed.

can you please take another look?

@devhl-labs
Copy link
Contributor

devhl-labs commented Dec 5, 2024

I wont object to this but Id really like it if the mustache net6orlater and related were instead moved to the abstract. This is one of the issues with the C# generators, many settings ought to be in the abstract. Since they're not they get defined differently in each generator.

Also, if you haven't, please add a sample to ensure the error you saw does not get reintroduced.

… exist in the same output. (uses defines in the c# instead of directives in the mustache processor).
updated netcore projects to be truly multi target capable.
updated project nuget references to be latest(ish) versions that still supported the relevant targets.
Added a couple references to remove security related warnings.
updated the multiple frameworks sample in .net47 to include net8.0
uppdated test project for httpclient/standard2.0/Petstore. It was woefully out of date. Project does contain handwritten tests.
@BryanAldrich BryanAldrich force-pushed the EditToAllowCoreAndFrameworkTargets branch from 88158f7 to 94c4bf7 Compare December 9, 2024 23:38
@BryanAldrich BryanAldrich mentioned this pull request Dec 10, 2024
5 tasks
@BryanAldrich
Copy link
Contributor Author

@devhl-labs I updated the mixed targets sample that was in the 4.7 category. It now targets standard, 47 and 8. There are a few models now with the DateOnly support (which is net6+). Previously, this would have failed to compile on framework or standard.

@BryanAldrich
Copy link
Contributor Author

@wing328 one of the automated builds failed, but i don't know how to resolve that.

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.

3 participants