From 4d39be63d543b0146545ee54c6ccc1f94a7815ba Mon Sep 17 00:00:00 2001 From: Roman Timushev Date: Fri, 25 Oct 2024 10:55:31 +0200 Subject: [PATCH] Fix scripted tests (#3) --- project/plugins.sbt | 4 ++-- .../com/coralogix/sbtprotofetch/ProtofetchBinary.scala | 2 +- .../com/coralogix/sbtprotofetch/ProtofetchPlugin.scala | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index fc642a8..48f5b8b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,2 @@ -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") diff --git a/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchBinary.scala b/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchBinary.scala index 5bc97f8..29b3cad 100644 --- a/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchBinary.scala +++ b/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchBinary.scala @@ -29,7 +29,7 @@ import java.util object ProtofetchBinary { - val DEFAULT_VERSION = "0.1.1" + val DEFAULT_VERSION = "0.1.8" def download( logger: Logger, diff --git a/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchPlugin.scala b/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchPlugin.scala index 57445a0..ec12339 100644 --- a/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchPlugin.scala +++ b/sbt-protofetch/src/main/scala/com/coralogix/sbtprotofetch/ProtofetchPlugin.scala @@ -55,11 +55,12 @@ object ProtofetchPlugin extends AutoPlugin { ) override lazy val projectSettings: Seq[Setting[_]] = Seq( - protofetchModuleFile := baseDirectory.value / "protofetch.toml", + protofetchModuleFile := baseDirectory.value / "protofetch.toml", + protofetchFetch / baseDirectory := protofetchModuleFile.value.getParentFile, protofetchLockFile := protofetchModuleFile.value.getParentFile / "protofetch.lock", protofetchOutputDirectory := { - val moduleFile = protofetchModuleFile.value - moduleFile.getParentFile / Protofetch.getOutputDirectory(moduleFile) + (protofetchFetch / baseDirectory).value / + Protofetch.getOutputDirectory(protofetchModuleFile.value) }, protofetchFetch / insideCI := insideCI.value, protofetchFetch := { @@ -69,6 +70,7 @@ object ProtofetchPlugin extends AutoPlugin { val s = streams.value val binaryFileInfo = FileInfo.lastModified(protofetchBinary.value) val moduleFileInfo = FileInfo.hash(protofetchModuleFile.value) + val base = (protofetchFetch / baseDirectory).value; val lockFile = protofetchLockFile.value val locked = (protofetchFetch / insideCI).value @@ -76,7 +78,7 @@ object ProtofetchPlugin extends AutoPlugin { (changed, _: (Inputs, Outputs)) => if (changed) { Protofetch.fetch( - baseDirectory.value, + base, s.log, binaryFileInfo.file, moduleFileInfo.file,