Skip to content

Modernize gradle code for (kotlin) build.gradle.kts projects (currently limited to (groovy) build.gradle projects) #1730

@tellypresence

Description

@tellypresence

Instructions on adding build dependencies work well, but only provide code for build.gradle files using groovy syntax.

For modern projects should also provide kotlin equivalents (for build.gradle.kts files) to be consistent with other android documentation; converting the task and tasks blocks is non-trivial

If top level project uses (kotlin) build.gradle.kts and build fails with error e.g.

> Cannot reference a Gradle script object from a Groovy closure as these are not supported with the 
  configuration cache.

there may be a workaround; first check project gradle.properties for this property

org.gradle.configuration-cache=true

and comment out or change to false (modern projects tend to set that value to org.gradle.configuration-cache=true by default)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions