Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Version 2.4
* [Fix] [#238](https://github.com/gradlex-org/jvm-dependency-conflict-resolution/issues/238) Patch DSL now works for dependencies with non-standard variant names (e.g. com.google.guava).
* [Deprecation] [#251](https://github.com/gradlex-org/jvm-dependency-conflict-resolution/issues/251) Deprecate GuavaComponentRule in favor of more general patch DSL.

## Version 2.3
* [New Rule] [#66](https://github.com/gradlex-org/jvm-dependency-conflict-resolution/issues/66) itext:itext / com.lowagie:itext (Thanks [Björn Kautler](https://github.com/Vampire) for reporting)
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,14 @@ If some of the transitive dependencies are not wanted in your case, you can fine
jvmDependencyConflicts {
patch {
module("com.google.guava:guava") {
removeDependency("com.google.code.findbugs:jsr305")
reduceToCompileOnlyApiDependency("com.google.errorprone:error_prone_annotations")
reduceToCompileOnlyApiDependency("com.google.j2objc:j2objc-annotations")
reduceToCompileOnlyApiDependency("org.jspecify:jspecify")
}
}
}
```

If you need the previous behavior for older Guava versions, you can explicitly apply the `GuavaComponentRule`.

```kotlin
dependencies.components {
withModule<GuavaComponentRule>("com.google.guava:guava")
}
```

## Disclaimer

Gradle and the Gradle logo are trademarks of Gradle, Inc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,24 @@
/**
* Kept for individual usage to get the patch functionality for older Guava versions.
* Might be removed in future versions.
*
* @deprecated use patch DSL:
* <p>
* <pre>
* jvmDependencyConflicts {
* patch {
* module("com.google.guava:guava") {
* reduceToCompileOnlyApiDependency("com.google.errorprone:error_prone_annotations")
* reduceToCompileOnlyApiDependency("com.google.j2objc:j2objc-annotations")
* reduceToCompileOnlyApiDependency("org.jspecify:jspecify")
* }
* }
* }
* </pre>
* </p>
*/
@CacheableRule
@Deprecated
abstract public class GuavaComponentRule implements ComponentMetadataRule {

private final static Attribute<String> TARGET_JVM_ENVIRONMENT_ATTRIBUTE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,8 @@ class GuavaClasspathTest extends Specification {
result.add([it[0], it[1], it[2], 'standard-jvm', 'runtimeClasspath'])
}
}
if (System.getProperty("gradleVersionUnderTest") == "7.6.4") {
// only do all permutations for one Gradle version
return result
}
// reduced amount of permutations
return result.subList(0, 80)
// The rule we are testing is Deprecated, until we remove it just test one permutation
return result.subList(0, 4)
}

@Unroll
Expand Down
Loading