Open Kennelly57 opened 7 months ago
Thanks for your interest in palantir/gradle-consistent-versions, @Kennelly57! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.
Type
Description
Before this PR
Currently, there is no support for using java-test-fixtures, a core Gradle plugin. When using a test fixture, this plugin will fail. As an example, here is an error message that will be logged:
Couldn't determine scope for dependency: com.h2database:h2:2.2.224
if the build.gradle file is as follows:
Related Issues
https://github.com/palantir/gradle-consistent-versions/issues/691 https://github.com/palantir/gradle-consistent-versions/issues/308
After this PR
==COMMIT_MSG== Adds support for use with java-test-fixtures, a core Gradle plugin. ==COMMIT_MSG==
A case to check for test sourceSets starting with the word "test" has been added, as suggested in #691 by @carterkozak. I have also included a test case to check that the lock file is properly generated when using the testFixtures plugin.
Possible downsides?
The logic is dead-simple, so it is unlikely to cause unforeseen bugs. However, this now means that the plugin may change some sourceSets from production to test. I imagine that this impact will be small because it is unlikely many people are labelling their production source sets with test as a prefix. If the impact is deemed too high, then I also would be happy just to scan for the prefix 'testFixture'