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

feat: remove the Riok.Mapperly.Abstractions runtime dependency #711

Merged
merged 1 commit into from
Sep 5, 2023
Merged

feat: remove the Riok.Mapperly.Abstractions runtime dependency #711

merged 1 commit into from
Sep 5, 2023

Conversation

latonz
Copy link
Contributor

@latonz latonz commented Sep 1, 2023

remove the Riok.Mapperly.Abstractions runtime dependency

Description

Creates a new Riok.Mapperly.Templates project with templates. Some Mapperly features may require such a template (currently only the reference handling). If such a template is required by a used Mapperly feature, Mapperly emites the template in a namespace which includes the name of the assembly of the target project. This is done to prevent collisions when using InternalsVisibleTo (see #685).
Currently the only template is the PreserveReferenceHandler which is emitted if reference handling is enabled for any mapper and the mapper does have mapper method definitions without a reference handling parameter and Mapperly needs to instantiate a IReferenceHandler.

The runtime dependency can be removed by setting PrivateAssets="all" ExcludeAssets="runtime" on the package reference. Unluckily we cannot set developmentDependency=true on the NuGet, since this would exclude the compile assets which are required for a source generator. See also NuGet/Home#10746.

Fixes #685

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@latonz latonz self-assigned this Sep 1, 2023
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #711 (752c00b) into main (4cd4e3a) will increase coverage by 0.11%.
The diff coverage is 97.97%.

@@            Coverage Diff             @@
##             main     #711      +/-   ##
==========================================
+ Coverage   91.21%   91.32%   +0.11%     
==========================================
  Files         198      201       +3     
  Lines        6601     6662      +61     
  Branches      820      821       +1     
==========================================
+ Hits         6021     6084      +63     
+ Misses        389      386       -3     
- Partials      191      192       +1     
Files Changed Coverage Δ
...c/Riok.Mapperly/Helpers/ImmutableEquatableArray.cs 51.72% <ø> (+4.84%) ⬆️
src/Riok.Mapperly/Output/MapperAndDiagnostics.cs 85.71% <80.00%> (+5.71%) ⬆️
src/Riok.Mapperly/Templates/TemplateReader.cs 92.85% <92.85%> (ø)
...iok.Mapperly.Templates/PreserveReferenceHandler.cs 100.00% <100.00%> (ø)
src/Riok.Mapperly/Descriptors/DescriptorBuilder.cs 100.00% <100.00%> (ø)
src/Riok.Mapperly/Descriptors/MapperDescriptor.cs 100.00% <100.00%> (ø)
...iok.Mapperly/Descriptors/Mappings/MethodMapping.cs 95.16% <100.00%> (+0.07%) ⬆️
...Mappings/UserDefinedExistingTargetMethodMapping.cs 87.17% <100.00%> (ø)
...serMappings/UserDefinedNewInstanceMethodMapping.cs 100.00% <100.00%> (ø)
.../UserDefinedNewInstanceRuntimeTargetTypeMapping.cs 100.00% <100.00%> (ø)
... and 8 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@latonz latonz marked this pull request as ready for review September 4, 2023 19:55
@latonz latonz marked this pull request as draft September 4, 2023 20:01
@latonz latonz marked this pull request as ready for review September 4, 2023 22:15
Creates a new Riok.Mapperly.Templates project with templates. Some Mapperly features may require such a template (currently only the reference handling). If such a template is required by a used Mapperly feature, Mapperly emites the template in a namespace which includes the name of the assembly of the target project. This is done to prevent collisions when using InternalsVisibleTo (see #685).
Currently the only themplate is the PreserveReferenceHandler which is emitted if reference handling is enabled for any mapper and the mapper does have mapper method definitions without a reference handling parameter and Mapperly needs to instantiate a IReferenceHandler.
@latonz latonz merged commit f26f026 into riok:main Sep 5, 2023
19 checks passed
@latonz latonz deleted the feat-rm-runtime-dependency branch September 5, 2023 06:17
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

🎉 This PR is included in version 3.2.0-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Remove Riok.Mapperly.Abstractions runtime dependency
2 participants