I don’t think there is anything on the API that will give you this information. The closest approximation that might work is to look at creation date of the cached file, but this won’t tell you when Gradle last checked to see if it was up-to-date.
What problem are you trying to solve with this information?
The real issue is ensuring that our “legacy” maven 1 dependency downloads are happening (hence my thought of displaying the time as a diagnostic). Similarly to maven, I want to download the SNAPSHOT dependency (500 MB) that is newer (yet NOT download anything NOT a SNAPSHOT. )
Do I have the following code snippet correct to implement the above?
Similarly to maven, I want to download the SNAPSHOT dependency (500 MB) that is newer (yet NOT download anything NOT a SNAPSHOT. )
Gradle will do this automatically, except that by default it will cache SNAPSHOT dependencies for 24 hours. (Gradle recognises SNAPSHOT dependencies by name and automatically flags them as “changing”).