Open magneticflux- opened 1 year ago
Makes sense. We should look into it. Have you thought about contributing? Thanks for reporting!
Can I upgrade the minimum Gradle version? providers.exec()
is only available since Gradle 7.5.
If sticking on 6.1 is required, I can make a custom ValueSource
to replace ProcessRunner
and work with Provider<T>
s.
Either way, it looks like Gradle APIs (Provider
, Project
, etc.) are going to have to reach deeper into the code. You commented in AutoVersion.java
"Main functionality, should never depend on any of Gradle APIs.", but the only way I see to preserve that is to wrap the entire functionality in a ValueSource
, which kinda defeats the purpose of Gradle's state tracking. It's a lightweight git log
call right now, but if we want to add some heavy feature later everything will be wrapped together.
If I could do whatever I wanted, I think I would start by making VersionsProvider
a ValueSource
, making a Provider
out of it, and then mapping that with the logic in AutoVersion
to get a Provider<String>
. Then we can just wire up that to the version
property and Gradle should handle the whole data graph and do whatever caching it wants to.
Hey can you summarize version we are compatible / not compatible with? Sorry for late response - if it takes too long for me to respond/figure it out I'll give you write permissions to the repo and green light for making a decision on this.
@magneticflux-, interested in becoming a project member of the Shipkit organization?
@mockitoguy @magneticflux - I've opened a PR for configuration cache support. https://github.com/shipkit/shipkit-auto-version/pull/187
Requirements for tasks to support configuration caching: https://docs.gradle.org/8.1.1/userguide/configuration_cache.html#config_cache:requirements
Errors logged:
In the documentation here, they suggest using
providers.exec()
to postpone execution until the property is actually needed.