palantir / gradle-consistent-versions

Compact, constraint-friendly lockfiles for your dependencies
Apache License 2.0
112 stars 15 forks source link

Adds support for use with java-test-fixtures, a core Gradle plugin. #1118

Open Kennelly57 opened 7 months ago

Kennelly57 commented 7 months ago

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:

dependencies {
    testFixturesApi 'com.h2database:h2'
}

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'

palantirtech commented 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.

changelog-app[bot] commented 7 months ago

Generate changelog in changelog-dir>`changelog/@unreleased`</changelog-dir

What do the change types mean? - `feature`: A new feature of the service. - `improvement`: An incremental improvement in the functionality or operation of the service. - `fix`: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way. - `break`: Has the potential to break consumers of this service's API, inclusive of both Palantir services and external consumers of the service's API (e.g. customer-written software or integrations). - `deprecation`: Advertises the intention to remove service functionality without any change to the operation of the service itself. - `manualTask`: Requires the possibility of manual intervention (running a script, eyeballing configuration, performing database surgery, ...) at the time of upgrade for it to succeed. - `migration`: A fully automatic upgrade migration task with no engineer input required. _Note: only one type should be chosen._
How are new versions calculated? - ❗The `break` and `manual task` changelog types will result in a major release! - 🐛 The `fix` changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease. - ✨ All others will result in a minor version release.

Type

- [ ] Feature - [ ] Improvement - [ ] Fix - [ ] Break - [ ] Deprecation - [ ] Manual task - [ ] Migration

Description

Adds support for use with java-test-fixtures, a core Gradle plugin. **Check the box to generate changelog(s)** - [ ] Generate changelog entry