Non-local task inputs / outputs

How to implement task inputs / outputs for non-local files without breaking the up-to-date mechanism?

I’m referring to what’s described in the Gradle manual at 15.8., Skipping tasks that are up-to-date. The responsible API for creating file collections, ‘Project.file(Object path)’, has been documented with Currently, only file: URLs are supported. for a long time already, and implementing custom objects derived from ‘java.io.File’ has turned out to be useless, as they are attempted to be converted back to vanilla files through normalization from their paths (‘getPath()’).

Is there a way to achieve this without re-implementing all or most of Gradle’s (local) file caching mechanisms?

The docs are still valid. You can implement your own up-to-date logic using ‘task.outputs.upToDateWhen { … }’, but it may take some effort.

How much work would it mean to build an abstraction on top of the current implementation that supports any kind of input, as long as the abstraction API provides modification time stamps and content hashes as required by the current implementation? Is this something that can or should be asked for as a separate feature request? Alternatively, is it possible to re-use the existing facilities selectively?