Skip to content

Add support for AGP 9 with built-in Kotlin #1008

@mannodermaus

Description

@mannodermaus

Adapted from the Android docs page:

Android Gradle plugin 9.0 introduces built-in Kotlin support and enables it by default. Developers no longer have to apply the org.jetbrains.kotlin.android (or kotlin-android) plugin in their build files to compile Kotlin source files.

When a project uses built-in Kotlin support, ktlint-gradle won't find a compatible plugin and therefore does not create any of the ktlintXXSourceSet tasks necessary to perform the actual checking/formatting of code.

Most likely, the list of detected plugins will need to be updated. From a cursory search of the AGP 9 codebase, there seems to be a com.android.built-in-kotlin plugin ID, but it's not applied by default when the setting is enabled. Further investigation needs to be done to figure out how to identify an Android project with built-in Kotlin turned on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions