-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toward a machine-independent incremental cache file #188
Conversation
82d2605
to
438f418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 👍 That's a good first step towards caching sbt-scalafix executions across machines.
build.sbt
Outdated
@@ -92,5 +92,6 @@ sbtPlugin := true | |||
scriptedBufferLog := false | |||
scriptedLaunchOpts ++= Seq( | |||
"-Xmx2048M", | |||
s"-Dplugin.version=${version.value}" | |||
s"-Dplugin.version=${version.value}", | |||
"-Dsbt-scalafix.uselastmodified=true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"-Dsbt-scalafix.uselastmodified=true" | |
"-Dsbt-scalafix.uselastmodified=true" // the caching scripted relies on sbt-scalafix only checking file attributes, not content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I don't have a better idea than changing the style for scripted (and I think a system property is better/more hidden than a setting key), as
$ exec chmod 000 src/main/scala/Valid.scala |
e74ac0c
to
800bd90
Compare
df9afba
to
2ae3d1b
Compare
* Switch from lastModified to hash caching style in order to produce machine-independent file stamps once sbt/sbt#6298 will solved. * Add a system property "sbt-scalafix.uselastmodified" to force the use of the lastModified caching style. (Used in scripted tests)
Stamps scalafix arguments using a hash of the files instead of relying on the lastMofified property in order to produce a machine-independent "args" cache.
2ae3d1b
to
8ff37a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The objective is to produce a machine-independent cache in order to include sbt-scalafix cache files in the remote cache artifact.
Two things are missing:
hash
instead oflastModified
style for cache stamping.This PR solves the second point.
To make the scripted tests green, i had to permit to get back the previous behaviour (
lastModified
). Done with a system property.