-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README.md #123
Update README.md #123
Conversation
Added the additional library dependencies required to use JavaCV in a SBT based project
Great! Could add the dependencies for FFmpeg, etc, etc as well? Thanks!
|
Platform, like |
@jpsacha Instead of that code, do you know if it is possible with sbt to call |
SBT can call anything that can be added to its classpath, so it could be possible to call |
@saudet What exactly javacpp "maven-plugin" do? |
I'm not sure myself, maybe nothing. sbt seems to treat "jar" artifacts differently from "maven-plugin" ones, unlike Maven itself. It's just a keyword required to indicate to Maven to look up for classes implementing the Mojo interface, which is BuildMojo in JavaCPP's case. |
I modified javacv-examples to use val platform = org.bytedeco.javacpp.Loader.getPlatform To make it work classpathTypes += "maven-plugin"
libraryDependencies += "org.bytedeco" % "javacpp" % "0.11" |
Great 👍 Thanks! BTW, do you know if it's possible to get the dependencies of JavaCV so we can loop over that and add the platform specific dependencies as well? |
If you just want to add dependency on specific preset libraries you could use in // Platform classifier for native library dependencies
val platform = org.bytedeco.javacpp.Loader.getPlatform
// Libraries with native dependencies
val bytedecoPresetLibs = Seq(
// library names and versions
"opencv" -> "2.4.11-0.11",
"flycapture" -> "2.7.3.19-0.11"
).flatMap { case (lib, ver) =>
Seq(
// Add both: dependency and its native binaries for the current `platform`
"org.bytedeco.javacpp-presets" % lib % ver,
"org.bytedeco.javacpp-presets" % lib % ver classifier platform
)
}
libraryDependencies ++= Seq(
"org.bytedeco" % "javacpp" % javacppVersion,
"org.bytedeco" % "javacv" % javacppVersion,
"org.scala-lang.modules" %% "scala-swing" % "1.0.1",
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test"
) ++ bytedecoPresetLibs It is also possible to automatically determine all "org.bytedeco.javacpp-presets" libraries from "javacv" dependencies and add |
Yes, I realize it would add a lot of unneeded dependencies. I am just hoping to have something like that as a sample build file, because we can't do it the Maven way. :) There is no hurry, so take your time! Thanks |
Hi, any updates on this? |
not yet , haven't had time to work on it yet |
Closing as this is no longer required with the "platform artifacts". We just need to add a dependency on "javacv-platform" or "opencv-platform", for example, which in turn depend on binaries for all platforms. This works not only with Maven, but with Gradle and sbt as well. |
Added the additional library dependencies required to use JavaCV in a SBT based project