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

Add support for excluding generated classes from mutation based on source path #364

Open
jwilmoth-ehs opened this issue Jul 12, 2024 · 1 comment

Comments

@jwilmoth-ehs
Copy link

We have a number of different 3rd party code generation tools (e.g. Mapstruct, DSG) that we do not want to mutate. Because of the different ways code is generated (e.g. annotation processor generated classes depend on src/main/java classes, src/main/java classes depend on types generated from graphql schema files) we're looking for an approach based on source paths being different for generated code vs. handwritten code. The plugin docs state:

To make life easier taskClasspath, mutableCodePaths, sourceDirs, reportDir, verbosity and pitestVersion are automatically set by the plugin. In addition sourceDirs, reportDir, verbosity and pitestVersion can be overridden by a user.

The reportDir and pitestVersion are indeed exposed in the plugin extension, but the sourceDirs property is not.

What is the recommended way to exclude build/generated/** classes from this plugin? Is it intended to be via the sourceDirs property? Some other property (e.g. mutableCodePaths)?

@szpak
Copy link
Owner

szpak commented Jul 12, 2024

Have you tried with mainSourceSets? You should be able to override the default sourceSets used by the plugin.

task.mutableCodePaths.setFrom(allMutableCodePaths)

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

No branches or pull requests

2 participants