asarkar / build-time-tracker

Gradle plugin that prints the time taken by the tasks in a build
Apache License 2.0
78 stars 9 forks source link

Plugin customizations are ignored if configuration cache is enabled #44

Closed dmitry-ryadnenko-izettle closed 2 years ago

dmitry-ryadnenko-izettle commented 2 years ago

Describe the bug

Build times are not sorted if build configuration is restored from Gradle configuration cache.

When configuration phase is properly executed (configuration is not restored from the cache) then everything is sorted as expected.

To Reproduce

Use sortBy = com.asarkar.gradle.buildtimetracker.Sort.ASC Gradle has configuration cache enabled. Make sure build configuration is restored from the Gradle configuration cache. By executing the build second time without changing gradle files for example.

Expected behavior

Build times are sorted.

Environment

asarkar commented 2 years ago

Make sure build configuration is restored from the Gradle configuration cache

by this, do you mean running with —configuration-cache?

dmitry-ryadnenko-izettle commented 2 years ago

Make sure build configuration is restored from the Gradle configuration cache

by this, do you mean running with —configuration-cache?

Yes

asarkar commented 2 years ago

I think I've been able to reproduce the bug, and have an idea what is causing it. For the record, the first execution works as expected, but subsequent executions don't. I'm looking into it and will report back with more information when I've found a solution.

asarkar commented 2 years ago

@dmitry-ryadnenko-izettle I've made a fix on this branch as version 4.3.0-rc. Please verify and let me know. You can find instructions here.

Also see discussion https://github.com/asarkar/build-time-tracker/discussions/45 on the topic of Configuration Cache.

dmitry-ryadnenko-izettle commented 2 years ago

@asarkar Works like a charm 😊

asarkar commented 2 years ago

v4.3.0 has been released.