Description
I can not find any direct mention of the gradle configuration cache in this project in terms of whether or not it is guaranteed that file system reads from kotlinx-io will always be registered by Gradle.
Gradle instruments code to register file system reads as inputs. As of right now, kotlinx-io uses java.io.FileOutputStream
and there is no issue. But theoretically, kotlinx-io's jvm module could one day use JNI. If it did, filesystem reads might not be registered by Gradle.
I raise this concern only because I am considering a general migration to kotlinx-io for file system operations in my gradle plugin, and want to make sure this is future proof.
Some ideas:
- Document somewhere this compatibility (to serve as a reminder and assurance)
- Create a test
Or maybe the idea that kotlinx-io
would ever do filesystem operations outside of java.io
or java.nio
is silly? I don't really know to be honest. If so, then maybe this whole concern of mine is also silly in which case maybe this could just be closed.
Or if this isn't silly and a test would really be worthwhile, I imagine maybe something like this:
- Use TestKit
- Build logic should read from a text file
- Run build three times during the test, writing to the file in between the second and third
- Test asserts that the build was configured the 1st and 3rd times but loaded from cache the second time
I'm open to trying to contributing such a test if it seems worthwhile. I never tried TestKit before so I'd be curious if it would work.