Hello. I am unable to try the detekt compiler plug...
# detekt
r
Hello. I am unable to try the detekt compiler plugin (1.23), as adding the plugin then enabling it with
enableCompilerPlugin = true
in
detekt { ... }
tells me "Val cannot be reassigned" and "The boolean literal does not conform to the expected type Property<Boolean>". I am at a complete loss here, does anyone have a pointer to solve this?
c
Gradle properties; use
.set(true)
r
That solved it, thank you! The documentation is in need of an update I guess 🙂
c
yea, the docs are likely for the Gradle Groovy DSL and don’t show the Kotlin equivalent. Thankfully upcoming Gradle versions add in the ability to override the
=
operator to get the same syntax (incubating in Gradle 8.1).
g
Ideally the docs are for Gradle 8.1 Kotlin DSL, that’s why they use the
=
We can change it to
.set()
if that allows for more compatibilities
c
It would be helpful to use set as that covers the vast percentage of Gradle versions/configurations. In 8.1
=
is not enabled by default, requiring an extra setting to enable it (it’s unsafe/incubating), and there are a small number of known issues with it (IDE support etc).
r
I'm indeed using Kotlin DSL with Gradle 8.1.1 - that's exactly where the issue is 🙂