Skip to content

Running Two Gradle Tasks Simultaneously on the Same Command Line #56

@haikalrios

Description

@haikalrios

I am attempting to run two Gradle tasks on the same command line, using the following command:

./gradlew releaseVersion build

However, when executing the releaseVersion and build tasks together, I noticed that the build version does not reflect the version of the tag/commit generated by the releaseVersion task. I suspect this might be related to Gradle's lifecycle, where configuration tasks are executed only once. It seems the plugin calculates the version and assigns it to a lazy property.

I executed Gradle without parallel mode enabled and also tried applying the mustRunAfter configuration on the build task, specifying that it should run after releaseVersion.

Is this behavior expected? Shouldn't there be an update to the version property after the releaseVersion task execution?

I managed to synchronize the build version with what would be generated after the version tag/commit by including the parameter -PdefaultPreRelease=

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions