Skip to content

Commit

Permalink
Update SBT syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydmeta committed Nov 19, 2016
1 parent 170475a commit 64b1f5d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := """sbt-javacpp"""

version := "1.9-SNAPSHOT"
version := "1.9"

organization := "org.bytedeco"

Expand All @@ -16,9 +16,9 @@ libraryDependencies += "org.bytedeco" % "javacpp" % "1.2.5"

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xlint", "-Xlog-free-terms")

publishTo <<= version { v: String =>
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
Expand Down
4 changes: 2 additions & 2 deletions project/scripted.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libraryDependencies <+= (sbtVersion) { sv =>
"org.scala-sbt" % "scripted-plugin" % sv
libraryDependencies += {
"org.scala-sbt" % "scripted-plugin" % sbtVersion.value
}

23 changes: 11 additions & 12 deletions src/main/scala/org/bytedeco/sbt/javacpp/Plugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ object Plugin extends AutoPlugin {
javaCppPlatform := Platform.current,
javaCppVersion := Versions.javaCppVersion,
javaCppPresetLibs := Seq.empty,
libraryDependencies <+= javaCppVersion { resolvedJavaCppVersion =>
"org.bytedeco" % "javacpp" % resolvedJavaCppVersion jar
libraryDependencies += {
"org.bytedeco" % "javacpp" % javaCppVersion.value jar
},
javaCppPresetDependencies
)
Expand All @@ -36,18 +36,17 @@ object Plugin extends AutoPlugin {

private def javaCppPresetDependencies: Def.Setting[Seq[ModuleID]] = {
import autoImport._
libraryDependencies <++= (javaCppPlatform, javaCppVersion, javaCppPresetLibs) {
(resolvedJavaCppPlatforms, resolvedJavaCppVersion, resolvedJavaCppPresetLibs) =>
val majorMinorJavaCppVersion = majorMinorOnly(resolvedJavaCppVersion)
resolvedJavaCppPresetLibs.flatMap {
case (libName, libVersion) => {
val generic = "org.bytedeco.javacpp-presets" % libName % s"$libVersion-$majorMinorJavaCppVersion" classifier ""
val platformSpecific = resolvedJavaCppPlatforms.map { platform =>
"org.bytedeco.javacpp-presets" % libName % s"$libVersion-$majorMinorJavaCppVersion" classifier platform
}
generic +: platformSpecific
libraryDependencies ++= {
val majorMinorJavaCppVersion = majorMinorOnly(javaCppVersion.value)
javaCppPresetLibs.value.flatMap {
case (libName, libVersion) => {
val generic = "org.bytedeco.javacpp-presets" % libName % s"$libVersion-$majorMinorJavaCppVersion" classifier ""
val platformSpecific = javaCppPlatform.value.map { platform =>
"org.bytedeco.javacpp-presets" % libName % s"$libVersion-$majorMinorJavaCppVersion" classifier platform
}
generic +: platformSpecific
}
}
}
}

Expand Down

0 comments on commit 64b1f5d

Please sign in to comment.