From dc25a9e18f43a385edaa651e9151cd7feffadc0f Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Tue, 8 Oct 2024 12:42:56 +0900 Subject: [PATCH] update artifactId in LauncherMain (#915) Co-authored-by: eugene yokota --- build.sbt | 2 +- launcher/src/main/scala/LauncherMain.scala | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index e066c902..aa101595 100644 --- a/build.sbt +++ b/build.sbt @@ -141,7 +141,7 @@ lazy val gitsupport = (project in file("cli-git")) ), libraryDependencies ++= scalatest, run / fork := true, - buildInfoKeys := Seq(name, version, scalaVersion, sbtVersion), + buildInfoKeys := Seq(name, version, scalaVersion, sbtVersion, scalaBinaryVersion), buildInfoPackage := "giter8" ) diff --git a/launcher/src/main/scala/LauncherMain.scala b/launcher/src/main/scala/LauncherMain.scala index ca609279..bf03e977 100644 --- a/launcher/src/main/scala/LauncherMain.scala +++ b/launcher/src/main/scala/LauncherMain.scala @@ -41,13 +41,13 @@ class LauncherProcessor extends Processor { Right("") } - /** See if there are JARs in ~/.giter8/boot/org.foundweekends.giter8/giter8_2.12/0.10.x. Otherwise, use Coursier to - * download the giter8 artifacts and move them into the boot dir for the next time. + /** See if there are JARs in ~/.giter8/boot/org.foundweekends.giter8/giter8_${scalaBinaryVersion}/${version}. + * Otherwise, use Coursier to download the giter8 artifacts and move them into the boot dir for the next time. */ def giter8Artifacts(g8v: String): Seq[File] = { val launcherVersion = "1.1.3" val bootHome = Home.home / "boot" - val bootDir = bootHome / "org.foundweekends.giter8" / "giter8_2.12" / g8v + val bootDir = bootHome / "org.foundweekends.giter8" / s"giter8_${giter8.BuildInfo.scalaBinaryVersion}" / g8v val bootJars = if (bootDir.exists) bootDir.listFiles.toList filter { _.getName.endsWith(".jar") } else Nil @@ -58,7 +58,13 @@ class LauncherProcessor extends Processor { import coursier._ val downloadedJars = Fetch() .addDependencies( - Dependency(Module(Organization("org.foundweekends.giter8"), ModuleName("giter8_2.12")), g8v), + Dependency( + Module( + Organization("org.foundweekends.giter8"), + ModuleName(s"giter8_${giter8.BuildInfo.scalaBinaryVersion}") + ), + g8v + ), Dependency(Module(Organization("org.scala-sbt"), ModuleName("launcher")), launcherVersion) ) .run()