Skip to content

2.5.0 is incompatible with configuration cache when extProperty setting is used #241

Description

@kdebski85

Gradle version: 8.13.
Plugin version: 2.5.0.

When extProperty setting is configured:

gitProperties {
    extProperty = 'gitProperties'
}

and project is built with displaying warnings:
./gradlew build --warning-mode all

The following warning is displayed:

> Task :generateGitProperties
Invocation of Task.project at execution time has been deprecated. This will fail with an error in Gradle 10.0. This API is incompatible with the configuration cache, which will become the only mode supported by Gradle in a future release. Consult the upgrading guide for further information: https://docs.gradle.org/8.13/userguide/upgrading_version_7.html#task_project

Note:
I want to use extProperty to access the git commit id and write it to application.yml. Is there any better way to do it?

processResources {
    filesMatching('**application.yml') {
        filter {
            it.replace('last-commit-hash', project.ext.gitProperties['git.commit.id.abbrev'].toString())
        }
    }
}

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