diff options
author | Stefan Zeiger <szeiger@novocode.com> | 2016-11-07 16:46:12 +0100 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2016-11-07 17:26:45 -0800 |
commit | 3f25085387725c4d2bff3bb0d937b605f4846ef7 (patch) | |
tree | 8fa3b8415671671d0925e88c461a79673686a390 /build.sbt | |
parent | c6e79dda2a331545c84d0b5a134be5e14e51112d (diff) | |
download | scala-3f25085387725c4d2bff3bb0d937b605f4846ef7.tar.gz scala-3f25085387725c4d2bff3bb0d937b605f4846ef7.tar.bz2 scala-3f25085387725c4d2bff3bb0d937b605f4846ef7.zip |
Don’t rely on deprecated ScalaInstance methods
Diffstat (limited to 'build.sbt')
-rw-r--r-- | build.sbt | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 => |