Skip to content

Commit 31bdb3e

Browse files
authored
Merge pull request #383 from ashawley/sbt-deprecated-scalaLibrary
Fix deprecated ScalaInstance.libraryJar
2 parents 0a48964 + 5501c95 commit 31bdb3e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

build.sbt

+6-4
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform)
117117
apiURL := Some(
118118
url(s"""https://scala.github.io/scala-xml/api/${"-.*".r.replaceAllIn(version.value, "")}/""")
119119
),
120-
apiMappings ++= Map(
121-
scalaInstance.value.libraryJar
122-
-> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")
123-
) ++ {
120+
apiMappings ++= scalaInstance.value.libraryJars.filter { file =>
121+
file.getName.startsWith("scala-library") && file.getName.endsWith(".jar")
122+
}.map { libraryJar =>
123+
libraryJar ->
124+
url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")
125+
}.toMap ++ {
124126
// http://stackoverflow.com/questions/16934488
125127
Option(System.getProperty("sun.boot.class.path")).flatMap { classPath =>
126128
classPath.split(java.io.File.pathSeparator).find(_.endsWith(java.io.File.separator + "rt.jar"))

0 commit comments

Comments
 (0)