Last active
March 14, 2024 05:44
-
-
Save gontard/f236e892278d262ad048ade8ebe1b33b to your computer and use it in GitHub Desktop.
Code samples for https://medium.com/@sebastien.boulet/84826f949ae8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compileIncremental := compileIncremental.dependsOn(pullRemoteCache).value, | |
products := products.dependsOn(pullRemoteCache).value, | |
copyResources := copyResources.dependsOn(pullRemoteCache).value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val cacheGenerators = settingKey[Seq[Task[Seq[File]]]]( | |
"List of tasks that generate cache files to include in remote cache artifacts." | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThisBuild / pushRemoteCacheTo := Some(MavenCache("local-cache", file("/tmp/remote-cache"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groupID % artifactID % revision % configuration | |
"tv.teads" % "api-commons" % "0.0.0-5e94c5faaaef95ea" "cached-compile" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cacheGenerators += Def.task { | |
val scalafixCacheDir = (scalafix / streams).value.cacheDirectory | |
val scalafixCacheFiles = | |
(scalafixCacheDir ** ("*" -- "out" -- "err")).filter(_.isFile).get() | |
scalafixCacheFiles | |
}.dependsOn(scalafixCheckAll).taskValue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cacheGenerators += Def | |
.task { | |
val s = (test / streams).value | |
val succeededFile = Defaults.succeededFile(s.cacheDirectory) | |
val cacheFiles = if (succeededFile.isFile) Seq(succeededFile) else Seq.empty | |
cacheFiles | |
}.dependsOn(testQuick.toTask("")).taskValue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment