Merge pull request #4733 from smarter/update-zinc

Replace usages of deprecated ScalaInstance#libraryJar
This commit is contained in:
eugene yokota 2019-05-28 21:29:29 -04:00 committed by GitHub
commit 3ebd01b4f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -3426,7 +3426,7 @@ object Classpaths {
def unmanagedScalaLibrary: Initialize[Task[Seq[File]]] = Def.taskDyn {
if (autoScalaLibrary.value && scalaHome.value.isDefined)
Def.task { scalaInstance.value.libraryJar :: Nil } else
Def.task { scalaInstance.value.libraryJars } else
Def.task { Nil }
}

View File

@ -15,7 +15,7 @@ lazy val root = (project in file("."))
artifact in (Compile, packageBin) := mainArtifact,
libraryDependencies ++= (if (baseDirectory.value / "retrieve" exists) publishedID :: Nil else Nil),
// needed to add a jar with a different type to the managed classpath
unmanagedClasspath in Compile += scalaInstance.map(_.libraryJar).value,
unmanagedClasspath in Compile ++= scalaInstance.value.libraryJars.toSeq,
classpathTypes := Set(tpe),
check := checkTask(dependencyClasspath).value,
checkFull := checkTask(fullClasspath).value

View File

@ -12,7 +12,7 @@ mainClass := Some("jartest.Main")
packageOptions in (Compile, packageBin) := {
def manifestExtra = {
val mf = new Manifest
mf.getMainAttributes.put(Attributes.Name.CLASS_PATH, makeString(scalaInstance.value.libraryJar :: Nil))
mf.getMainAttributes.put(Attributes.Name.CLASS_PATH, makeString(scalaInstance.value.libraryJars))
mf
}
(packageOptions in (Compile, packageBin)).value :+ Package.JarManifest(manifestExtra)

View File

@ -1,3 +1,5 @@
import Path.makeString
name := "Main Resources Test"
version := "0.1"
@ -8,7 +10,7 @@ packageOptions := {
def manifestExtra = {
import java.util.jar._
val mf = new Manifest
mf.getMainAttributes.put(Attributes.Name.CLASS_PATH, scalaInstance.value.libraryJar.getAbsolutePath)
mf.getMainAttributes.put(Attributes.Name.CLASS_PATH, makeString(scalaInstance.value.libraryJars))
mf
}
Package.JarManifest(manifestExtra) +: packageOptions.value