From 1f31f01f9c0ad73a70a9e3dd23c9d8ec27fd1792 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Mon, 28 Aug 2017 17:44:44 -0700 Subject: Upgrade to sbt 1.0.1 --- README.md | 2 +- .../sbt/jni/plugins/RunDependencyFixPlugin.scala | 44 ---------------------- plugin/src/sbt-test/sbt-jni/multiclasses/build.sbt | 4 +- plugin/src/sbt-test/sbt-jni/simple/build.sbt | 3 +- .../sbt-jni/simple/project/build.properties | 2 +- project/build.properties | 2 +- 6 files changed, 5 insertions(+), 52 deletions(-) delete mode 100644 plugin/src/main/scala/ch/jodersky/sbt/jni/plugins/RunDependencyFixPlugin.scala diff --git a/README.md b/README.md index 0e1cd68..791ef37 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ This plugin packages native libraries produced by JniNative in a way that they c ```scala lazy val core = project in file("myproject-core"). // regular scala code with @native methods - dependsOnRun(native) // remove this if `core` is a library, leave choice to end-user + dependsOn(native % Runtime) // remove this if `core` is a library, leave choice to end-user lazy val native = project in file("myproject-native"). // native code and build script enablePlugin(JniNative) // JniNative needs to be explicitly enabled diff --git a/plugin/src/main/scala/ch/jodersky/sbt/jni/plugins/RunDependencyFixPlugin.scala b/plugin/src/main/scala/ch/jodersky/sbt/jni/plugins/RunDependencyFixPlugin.scala deleted file mode 100644 index 3c4f92c..0000000 --- a/plugin/src/main/scala/ch/jodersky/sbt/jni/plugins/RunDependencyFixPlugin.scala +++ /dev/null @@ -1,44 +0,0 @@ -package ch.jodersky.sbt.jni.plugins - -import sbt._ -import sbt.Keys._ -import java.io.File - -/** Adds the extension method `dependsOnRun` to projects, to work around an sbt - * bug. */ -object RunDependencyFixPlugin extends AutoPlugin { - - override def requires = plugins.CorePlugin - override def trigger = allRequirements - - object autoImport { - - val runClasspath = taskKey[Seq[sbt.internal.util.Attributed[File]]]("Classpath used in run task") - - def dependsOnRunSettings(project: Project) = Seq( - runClasspath in Compile ++= (runClasspath in Compile in project).value, - run := { - Defaults.runTask( - runClasspath in Compile, - mainClass in Compile in run, - runner in run - ).evaluated - } - ) - - implicit class RichProject(project: Project) { - @deprecated("Workaround for https://github.com/sbt/sbt/issues/3425. " + - "Use `dependsOn( % Runtime)` when fixed.", "1.3.0") - def dependsOnRun(other: Project) = { - project.settings(dependsOnRunSettings(other): _*) - } - } - - } - import autoImport._ - - override def projectSettings = Seq( - runClasspath in Compile := (fullClasspath in Compile).value - ) - -} diff --git a/plugin/src/sbt-test/sbt-jni/multiclasses/build.sbt b/plugin/src/sbt-test/sbt-jni/multiclasses/build.sbt index c1352d9..d12a711 100644 --- a/plugin/src/sbt-test/sbt-jni/multiclasses/build.sbt +++ b/plugin/src/sbt-test/sbt-jni/multiclasses/build.sbt @@ -5,9 +5,7 @@ lazy val root = (project in file(".")). lazy val core = (project in file("core")). dependsOn(native1 % Runtime). - dependsOn(native2 % Runtime). - dependsOnRun(native1). - dependsOnRun(native2) + dependsOn(native2 % Runtime) lazy val native1 = (project in file("native1")). settings(sourceDirectory in nativeCompile := sourceDirectory.value). diff --git a/plugin/src/sbt-test/sbt-jni/simple/build.sbt b/plugin/src/sbt-test/sbt-jni/simple/build.sbt index b3d441a..cd490b0 100644 --- a/plugin/src/sbt-test/sbt-jni/simple/build.sbt +++ b/plugin/src/sbt-test/sbt-jni/simple/build.sbt @@ -6,8 +6,7 @@ lazy val root = (project in file(".")). lazy val core = (project in file("core")). settings(libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % "test"). settings(target in javah := (sourceDirectory in nativeCompile in native).value / "include"). - dependsOn(native % Runtime). - dependsOnRun(native) + dependsOn(native % Runtime) lazy val native = (project in file("native")). settings(sourceDirectory in nativeCompile := sourceDirectory.value). diff --git a/plugin/src/sbt-test/sbt-jni/simple/project/build.properties b/plugin/src/sbt-test/sbt-jni/simple/project/build.properties index 94005e5..7b6213b 100644 --- a/plugin/src/sbt-test/sbt-jni/simple/project/build.properties +++ b/plugin/src/sbt-test/sbt-jni/simple/project/build.properties @@ -1 +1 @@ -sbt.version=1.0.0 +sbt.version=1.0.1 diff --git a/project/build.properties b/project/build.properties index 94005e5..7b6213b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.0.0 +sbt.version=1.0.1 -- cgit v1.2.3