would it be worth a feature request to have a more...
# compiler
z
would it be worth a feature request to have a more specific warning for this/not break -Werror? Since it's controlled at the gradle level it's not possible to suppress this warning without suppressing warnings for all elements in the project
Copy code
w: K2 kapt is in Alpha. Use with caution.
e: warnings found and -Werror specified
😞 1
e
But breaking -Werror is a tradition!
d
You can describe your situation in KT-73571 BTW the specific problem with warning about K2 KAPT will be gone in 2.1.20, as we switched the default
u
-Xsuppress-version-warnings
z
thanks, and will do
@udalov that flag doesn't actually appear to change anything in 2.1.0 when I test it. The generate stubs task still emits a warning
u
Are you sure you've applied it to the correct task?
z
yes, applied on the generate stubs task, which is the one that emits the warning
u
And no other code modifies
freeCompilerArgs
for this task?
z
not in a destructive way, no. Append-only
u
I have no idea how that's possible. The warning was literally guarded on the condition of there being no
-Xsuppress-version-warnings
in the compiler arguments. If you feel adventurous, you can dump compiler arguments by passing
--debug
to Gradle (output to file since it's very large) and try looking for it there. But anyway, this warning is removed in 2.1.20.
g
Adding the flag like this doesn’t work for me
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs.class).configureEach {
    compilerOptions {
        freeCompilerArgs.add("-Xsuppress-version-warnings")
    }
}
But adding it globally through the extension works
Copy code
kotlin {
    compilerOptions {
        freeCompilerArgs.add("-Xsuppress-version-warnings")
    }
}
I’ve checked the debug logs and only in the second case
-Xsuppress-version-warnings
was in the compiler args
z
Iiiinteresting. Yeah I did it through the task directly as well