i'm using gradle version catalogs and to remove th...
# gradle
d
i'm using gradle version catalogs and to remove the warning about libs accessors in build.gradle.kts i use
@Suppress("DSL_SCOPE_VIOLATION")
(issue KTIJ-19369), but after sync project it errors with:
Copy code
Line 1: @Suppress("DSL_SCOPE_VIOLATION")
                                          ^ Expecting an expression
ScriptCompilationException(errors=[ScriptCompilationError(message=Expecting an expression, location=C:\Users\me\.gradle\.tmp\gradle-kotlin-dsl-2485107686268774832.tmp\build.gradle.kts (1:33))])
how to fix this issue? cannot always reproduce
v
Hard to say without a reproducer. Never seen it. One work-around would of course be to not use the annotation but just look away. :-)
c
Where do you put the annotation? on the
alias
, the
plugins
or the “file”?
d
First line of build file (I had no imports), above the plugins block
c
if you want it to have a file scope you’ll need
@file:Suppress(...)
. Maybe thats the issue. I use it on the
alias
itself and it works without issues.
d
I'll try, but for me it always worked on top the plugins block, idk why sometimes it breaks
v
For me too when I used it. Probably better to find a way to reproduce it so that someone can fix it. 🙂
d
ok, annotation with file scope works fine; ty all
200 Views