I use GitHub's Immutables library for Android development, and now I want to give it a try on the backend side as well.
In Android, all I need to to in order to use the library is this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// immutable entities generation
provided "org.immutables:value:2.5.5" // for annotations
provided "org.immutables:builder:2.5.5" // for annotations
provided "org.immutables:gson:2.5.5" // for annotations
... other dependencies
}
When I attempt to copy the above dependencies into build.gradle
of my Java project, I get this error:
Error:(24, 0) Gradle DSL method not found: 'provided()'
I tried to replace provided
with compileOnly
and compile
, but then the implementations of the interfaces annotated with @Value.Immutable
are not generated.
How do I make it work?