From 37fa5573f00c69d5381aa7089dfbbccf9a7e6c14 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Tue, 20 Oct 2020 23:13:28 +0900 Subject: [PATCH] improve remote cache extract log message build.sbt ``` lazy val common = Def.settings( scalaVersion := "2.12.12", pushRemoteCacheTo := Some( MavenCache("local-cache", (ThisBuild / baseDirectory).value / "remote-cache") ), remoteCacheId := "fixed-id", remoteCacheIdCandidates := Seq(remoteCacheId.value) ) pushRemoteCache := {} pullRemoteCache := {} lazy val p1 = project.settings(common) lazy val p2 = project.settings(common) lazy val p3 = project.settings(common) lazy val p4 = project.settings(common) lazy val p5 = project.settings(common) lazy val p6 = project.settings(common) lazy val p7 = project.settings(common) lazy val p8 = project.settings(common) lazy val p9 = project.settings(common) ``` run: `sbt pushRemoteCache clean pullRemoteCache` before ``` [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-test) [info] remote cache artifact extracted for Some(cached-compile) [info] remote cache artifact extracted for Some(cached-test) ``` after ``` [info] remote cache artifact extracted for p2:p2:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p9:p9:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p8:p8:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p7:p7:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p5:p5:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p1:p1:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p5:p5:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p7:p7:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p2:p2:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p8:p8:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p9:p9:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p1:p1:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p3:p3:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p3:p3:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p4:p4:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p4:p4:0.0.0-fixed-id Some(cached-test) [info] remote cache artifact extracted for p6:p6:0.0.0-fixed-id Some(cached-compile) [info] remote cache artifact extracted for p6:p6:0.0.0-fixed-id Some(cached-test) ``` --- main/src/main/scala/sbt/internal/RemoteCache.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/main/scala/sbt/internal/RemoteCache.scala b/main/src/main/scala/sbt/internal/RemoteCache.scala index be8588a836..cf758264e4 100644 --- a/main/src/main/scala/sbt/internal/RemoteCache.scala +++ b/main/src/main/scala/sbt/internal/RemoteCache.scala @@ -114,10 +114,10 @@ object RemoteCache { findJar(classifier, v, jars) match { case Some(jar) => extractJar(art, jar) - log.info(s"remote cache artifact extracted for $classifier") + log.info(s"remote cache artifact extracted for $p $classifier") case None => - log.info(s"remote cache artifact not found for $classifier") + log.info(s"remote cache artifact not found for $p $classifier") } } found = true