When using Vavr with $Patterns / $Unapply, one must add additional configuration to its dependencies, otherwise Gradle does not process annotations by default.
This would be nice to mention this in the documentation.
It seems that annotationProcessor("io.vavr", "vavr-match-processor", vavrVersion) does the trick.
Thanks for the hint, will do!
Do you have (a minimal) Gradle config that I can take as example?
plugins {
java
}
group = "com.sir4ur0n.github"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
val vavrVersion = "0.10.0"
// Provides @Patterns, @Unapply, Tuple0..8
implementation("io.vavr", "vavr", vavrVersion)
// Processes patterns during compilation, outputs them in build/classes by default
annotationProcessor("io.vavr", "vavr-match-processor", vavrVersion)
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
@Sir4ur0n thank you, that helps! I think there also needs to be the additional dependency
compileOnly("io.vavr", "vavr-match", vavrVersion)
Not needed explicitly, it's a transitive dependency of io.vavr:vavr. Anyway you also need io.vavr:vavr tu build patterns using Tuple0..8.
I see. That is interesting because vavr-match should only be a compile time dependency of Vavr. I think the dependency 'leaked' into the library with the PR #2294.
I need to fix that in the next version.

compile is the default scope in maven if no scope is specified. <scope>compile</scope> thus should be redundant. See maven docs.
Sorry, I confused Maven鈥檚 compile with Gradle鈥檚 compileOnly.
What I meant was that we might need s.th. like Maven鈥檚 provided in order not to leak vavr-match as transitive dependency.
See
https://blog.gradle.org/introducing-compile-only-dependencies
The important parts:


Most helpful comment
Sorry, I confused Maven鈥檚
compilewith Gradle鈥檚compileOnly.What I meant was that we might need s.th. like Maven鈥檚
providedin order not to leakvavr-matchas transitive dependency.See
https://blog.gradle.org/introducing-compile-only-dependencies
The important parts: