-
Notifications
You must be signed in to change notification settings - Fork 327
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
netstandard 2.0 compile #655
base: master
Are you sure you want to change the base?
Conversation
Thanks @Jojoshua, I will take a look. At first glance it seems the test suite failed, but I haven't taken a closer look yet. Did you run the tests locally? |
@andrerav For it to work, also need to remove all links to MapsterDynamic. not Working map to interface and this tests But this strange the specified code was also supported by netstandard2.0 AssemblyBuilder Now in official doc it only support beginning from netstandard2.1 |
This will work without global refactoring the code. IMapFrom dont working |
@andrerav I didn't run any tests locally. I only had 30 mins yesterday with a goal to make it build without errors. It went smooth except for the one method I had to comment out for imap because default method interfaces are not supported. I feel like this is could be easily changed when I understand what it's for. This was my first look at the codebase, I will try to give this another 30 today and run the tests. If anyone can get tests working before I get to it feel free. |
@Jojoshua You get Mapster.dll for netstandart 2.0 after compile. upd:
|
The project wouldn't compile for me without adding those. System.Reflection.Emit has netstandard 2.0 support but if you don't require it standalone it's going to want to pull it from net6/7. |
@andrerav Ok, tests are now passing for me locally. Does the PR automatically run the tests or do you need to execute it? |
@andrerav How do you see Mapster's public api extension strategy?
I asked this question to understand Is there any need for an implementation for IMapFrom in netstandard 2.0 build. Without targeting Maspter to net 6.0. IMapFrom just wouldn't exist. |
@DocSvartz @Jojoshua IMapFrom was added as a new feature in 7.4.0 (see #533). It's perfectly fine to leave this out from a netstandard2.0-compatible version of Mapster in my opinion. It's impossible for anyone to have put that interface to use in that user group :) We can add a note about this in the documentation. |
That makes sense. With that in mind perhaps the PR is good to go? Could you try running the tests again? |
@DocSvartz @Jojoshua The tests passed, so this looks promising :) I will check that the packaging works as expected before merging, but I don't expect any problems. |
@andrerav @Jojoshua This is what I said, that the tests will pass. But they only test for Net 6.0. and Net 7.0. If you create a separate group of tests. Which will be target at net 4.8 (max support netstandard 2.0) for example, then the ImapFrom test will not pass In the created library to netstandard 2.0 this code will be cut out and accordingly. There is simply nothing to work there :)
I want to say that testing in net 7.0 does not guarantee that it will also work in netstandard 2.0 |
I am writing this more as a warning to the author that he could potentially get behavior that he did not expect. If he uses it where he wanted (an environment where there is access only to the netstandard 2.0 ). Because the tests do not use the target library for this case. |
No description provided.