sbt / io

IO module for sbt
Apache License 2.0
41 stars 50 forks source link

Prefer JavaMillis starting from Java 10 #274

Closed slandelle closed 5 years ago

slandelle commented 5 years ago

Motivation:

JavaMillis is currently only preferred for Java 11+. But bug that chopped off millis from Files.getLastModifiedTime was fixed in Java 10, see https://bugs.openjdk.java.net/browse/JDK-8177809

Modification:

Have jdkTimestamps evaluate to true for Java 10.

Result:

Milli doesn't use JNA on Java 10.

slandelle commented 5 years ago

Side question: why do you prefer java.nio.Files#getLastModifiedTime over java.io.File#lastModified?

eatkins commented 5 years ago

Side question: why do you prefer java.nio.Files#getLastModifiedTime over java.io.File#lastModified?

Long term we want to move all of the sbt io apis from io -> nio. Even if the public api exposes io, we have started moving the implementations to largely use nio under the hood.