After migrating from Groovy to Kotlin DSL the settings.gradle is now getting a lint warning about the usage of this code
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
}
}
Currently using AGP 8.1.3
Even when creating a new project using the IDE's template that is in Kotlin DSL, the above configuration exist and also got warning.
Why this is not showing when using Groovy, it seems there is an issue with Kotlin DSL or the lint just cannot detect it when in Groovy?


If you convert the
dependencyManagement {}block back toGroovyDSL and try to navigate torepositoryhandler, for example, you end up in the same file with same@Incubatingannotations: https://github.com/gradle/gradle/blob/master/subprojects/core-api/src/main/java/org/gradle/api/initialization/resolve/DependencyResolutionManagement.java#L44But why does it show warnings for Kotlin but not for Groovy? According to this answer in the Gradle GitHub repo: https://github.com/gradle/gradle/issues/20328#issuecomment-1083788360
The problem is not with Gradle. It's the way
Intellij-based IDEs run their inspections on.gradleand.ktsfiles. TheUnstable API usageinspection not working for.gradlefiles for some reason.Seems like to make it work
IntelliJguys should add it to theGradlesections in their Inspection catalog. As for now, seems like it can handle only@Deprecatedannotation