mirror of https://github.com/sbt/sbt.git
Unify calculation of remoteCacheId and remoteCacheIdCandidates
This commit is contained in:
parent
c07de68cf5
commit
3e8073151b
|
|
@ -26,16 +26,17 @@ import sbt.util.Logger
|
||||||
object RemoteCache {
|
object RemoteCache {
|
||||||
final val cachedCompileClassifier = "cached-compile"
|
final val cachedCompileClassifier = "cached-compile"
|
||||||
final val cachedTestClasifier = "cached-test"
|
final val cachedTestClasifier = "cached-test"
|
||||||
|
final val commitLength = 10
|
||||||
|
|
||||||
def gitCommitId: String =
|
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] =
|
def gitCommitIds(n: Int): List[String] =
|
||||||
scala.sys.process
|
scala.sys.process
|
||||||
.Process("git log -n " + n.toString + " --format=%H")
|
.Process("git log -n " + n.toString + " --format=%H")
|
||||||
.!!
|
.!!
|
||||||
.linesIterator
|
.linesIterator
|
||||||
.toList
|
.toList
|
||||||
.map(_.take(10))
|
.map(_.take(commitLength))
|
||||||
|
|
||||||
lazy val globalSettings: Seq[Def.Setting[_]] = Seq(
|
lazy val globalSettings: Seq[Def.Setting[_]] = Seq(
|
||||||
remoteCacheId := gitCommitId,
|
remoteCacheId := gitCommitId,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue