openrewrite / openrewrite/rewrite
Add `SourceSet#isTest()` method
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 570
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 261
Description
Currently SourceSet only has a name property (getName() method). Currently, there are some recipes which use the name to derive if a source set contains test or production sources by checking if the name equals test or contains test. This will typically work (at least in Maven), but at least for Bazel the source set names will be a lot less standardized.
Since it is only the build tool which knows which source sets contain test sources, it would probably make sense if the SourceSet either declared an isTest() method or something like a getKind() method returning an enum (with values PRODUCTION, TEST, and in the future possibly others).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the SourceSet API and the recipes that infer test sources from getName(), then inspect the build-tool implementations that create source sets. Done means the API clearly identifies test source sets across tools and the affected name-based checks are updated, with tests covering production and test cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100