From 3f25085387725c4d2bff3bb0d937b605f4846ef7 Mon Sep 17 00:00:00 2001 From: Stefan Zeiger Date: Mon, 7 Nov 2016 16:46:12 +0100 Subject: Don’t rely on deprecated ScalaInstance methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sbt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build.sbt') diff --git a/build.sbt b/build.sbt index cd9a23b6fe..42a7a8a00c 100644 --- a/build.sbt +++ b/build.sbt @@ -104,7 +104,11 @@ lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings + // sbt claims that s.isManagedVersion is false even though s was resolved by Ivy // We create a managed copy to prevent sbt from putting it on the classpath where we don't want it if(s.isManagedVersion) s else { - val s2 = new ScalaInstance(s.version, s.loader, s.libraryJar, s.compilerJar, s.extraJars, Some(s.actualVersion)) + val jars = s.jars + val libraryJar = jars.find(_.getName contains "-library").get + val compilerJar = jars.find(_.getName contains "-compiler").get + val extraJars = jars.filter(f => (f ne libraryJar) && (f ne compilerJar)) + val s2 = new ScalaInstance(s.version, s.loader, libraryJar, compilerJar, extraJars, Some(s.actualVersion)) assert(s2.isManagedVersion) s2 } @@ -756,7 +760,7 @@ lazy val root: Project = (project in file(".")) publishLocal := {}, commands ++= ScriptCommands.all, extractBuildCharacterPropertiesFile := { - val jar = (scalaInstance in bootstrap).value.compilerJar + val jar = (scalaInstance in bootstrap).value.allJars.find(_.getName contains "-compiler").get val bc = buildCharacterPropertiesFile.value val packagedName = "scala-buildcharacter.properties" IO.withTemporaryDirectory { tmp => -- cgit v1.2.3