magnars / optimus

A Ring middleware for frontend performance optimization.
364 stars 23 forks source link

Support for Java 9+ #65

Closed radhikalism closed 5 years ago

radhikalism commented 5 years ago

On trying to run lein midje on master with a JDK newer than JDK8, I encountered a variety of errors. Some were caused by midje or lein-midje being out of date, so this commit bumps those dependencies.

Newer JDKs also have millisecond resolution for getLastModified, which breaks asset creation tests that rely on the seconds resolution of JDK8 (which is encoded into test-with-files too). Rather than switch between resolutions (which I think may be tricky with test-with-files) this commit simply truncates the last-modified value to seconds to retain JDK8's behavior and keep tests passing.

(Note there may be a race condition edge case where last-modified is a full 1000ms later than test-with-files expects, but I'm not sure how to repro this reliably yet or if it's pre-existing in test-with-files. It can cause intermittent test failures.)

Comments?

magnars commented 5 years ago

This looks good. It seems like we also need to update the travis script to include proper versions of Java, because the build is failing. Would you be willing to give that a shot as part of this PR?

radhikalism commented 5 years ago

So to explain the changes to the travis config:

I'm not sure if Gravis-CI is going to be entirely reliable, but may be worth a try considering the known-problematic default alternative.

magnars commented 5 years ago

Outstanding. That was above and beyond. Thank you!