mirror of https://github.com/sbt/sbt.git
Merge pull request #4733 from smarter/update-zinc
Replace usages of deprecated ScalaInstance#libraryJar
This commit is contained in:
commit
3ebd01b4f3
|
|
@ -3426,7 +3426,7 @@ object Classpaths {
|
||||||
|
|
||||||
def unmanagedScalaLibrary: Initialize[Task[Seq[File]]] = Def.taskDyn {
|
def unmanagedScalaLibrary: Initialize[Task[Seq[File]]] = Def.taskDyn {
|
||||||
if (autoScalaLibrary.value && scalaHome.value.isDefined)
|
if (autoScalaLibrary.value && scalaHome.value.isDefined)
|
||||||
Def.task { scalaInstance.value.libraryJar :: Nil } else
|
Def.task { scalaInstance.value.libraryJars } else
|
||||||
Def.task { Nil }
|
Def.task { Nil }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ lazy val root = (project in file("."))
|
||||||
artifact in (Compile, packageBin) := mainArtifact,
|
artifact in (Compile, packageBin) := mainArtifact,
|
||||||
libraryDependencies ++= (if (baseDirectory.value / "retrieve" exists) publishedID :: Nil else Nil),
|
libraryDependencies ++= (if (baseDirectory.value / "retrieve" exists) publishedID :: Nil else Nil),
|
||||||
// needed to add a jar with a different type to the managed classpath
|
// 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),
|
classpathTypes := Set(tpe),
|
||||||
check := checkTask(dependencyClasspath).value,
|
check := checkTask(dependencyClasspath).value,
|
||||||
checkFull := checkTask(fullClasspath).value
|
checkFull := checkTask(fullClasspath).value
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ mainClass := Some("jartest.Main")
|
||||||
packageOptions in (Compile, packageBin) := {
|
packageOptions in (Compile, packageBin) := {
|
||||||
def manifestExtra = {
|
def manifestExtra = {
|
||||||
val mf = new Manifest
|
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
|
mf
|
||||||
}
|
}
|
||||||
(packageOptions in (Compile, packageBin)).value :+ Package.JarManifest(manifestExtra)
|
(packageOptions in (Compile, packageBin)).value :+ Package.JarManifest(manifestExtra)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Path.makeString
|
||||||
|
|
||||||
name := "Main Resources Test"
|
name := "Main Resources Test"
|
||||||
|
|
||||||
version := "0.1"
|
version := "0.1"
|
||||||
|
|
@ -8,7 +10,7 @@ packageOptions := {
|
||||||
def manifestExtra = {
|
def manifestExtra = {
|
||||||
import java.util.jar._
|
import java.util.jar._
|
||||||
val mf = new Manifest
|
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
|
mf
|
||||||
}
|
}
|
||||||
Package.JarManifest(manifestExtra) +: packageOptions.value
|
Package.JarManifest(manifestExtra) +: packageOptions.value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue