aboutsummaryrefslogtreecommitdiff
path: root/jni-plugin/src/main/scala/ch/jodersky/sbt/jni/plugins/JniLoading.scala
blob: 599bfa1678987b6e22bc9afe766f6a40fabbf79d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package ch.jodersky.sbt.jni
package plugins

import sbt._
import sbt.Keys._
import util.ByteCode

/**
 * Enables loading native libraries from the classpath, typically created
 * from a project using JniPackaging.
 */
object JniLoading extends AutoPlugin {

  override def requires = plugins.JvmPlugin

  lazy val settings = Seq(

    //enable enhanced native library extraction
    libraryDependencies += "ch.jodersky" %% "jni-library" % Version.PluginVersion,

    //fork new JVM, since native libraries can only be loaded once
    fork in run := true

  )

  override lazy val projectSettings = settings

}