Merge pull request #5622 from iRevive/issue-5621

Unify calculation of remoteCacheId and remoteCacheIdCandidates
This commit is contained in:
eugene yokota 2020-06-16 19:52:27 -04:00 committed by GitHub
commit 8a9857617d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -26,16 +26,17 @@ import sbt.util.Logger
object RemoteCache {
final val cachedCompileClassifier = "cached-compile"
final val cachedTestClasifier = "cached-test"
final val commitLength = 10
def gitCommitId: String =
scala.sys.process.Process("git rev-parse --short HEAD").!!.trim
scala.sys.process.Process("git rev-parse HEAD").!!.trim.take(commitLength)
def gitCommitIds(n: Int): List[String] =
scala.sys.process
.Process("git log -n " + n.toString + " --format=%H")
.!!
.linesIterator
.toList
.map(_.take(10))
.map(_.take(commitLength))
lazy val globalSettings: Seq[Def.Setting[_]] = Seq(
remoteCacheId := gitCommitId,