forked from dgiglio/docker-face_rec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
80 lines (66 loc) · 2.8 KB
/
build.sbt
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name := "opencv2-cookbook"
organization := "javacv.examples"
val javacvVersion = "0.9"
val javacppVersion = "0.9"
version := javacvVersion
scalaVersion := "2.11.2"
scalacOptions ++= Seq("-unchecked", "-deprecation", "-optimize", "-Xlint")
// Some dependencies like `javacpp` are packaged with maven-plugin packaging
classpathTypes += "maven-plugin"
// Determine current platform
val platform = {
// Determine platform name using code similar to javacpp
// com.googlecode.javacpp.Loader.java line 60-84
val jvmName = System.getProperty("java.vm.name").toLowerCase
var osName = System.getProperty("os.name").toLowerCase
var osArch = System.getProperty("os.arch").toLowerCase
if (jvmName.startsWith("dalvik") && osName.startsWith("linux")) {
osName = "android"
} else if (jvmName.startsWith("robovm") && osName.startsWith("darwin")) {
osName = "ios"
osArch = "arm"
} else if (osName.startsWith("mac os x")) {
osName = "macosx"
} else {
val spaceIndex = osName.indexOf(' ')
if (spaceIndex > 0) {
osName = osName.substring(0, spaceIndex)
}
}
if (osArch.equals("i386") || osArch.equals("i486") || osArch.equals("i586") || osArch.equals("i686")) {
osArch = "x86"
} else if (osArch.equals("amd64") || osArch.equals("x86-64") || osArch.equals("x64")) {
osArch = "x86_64"
} else if (osArch.startsWith("arm")) {
osArch = "arm"
}
val platformName = osName + "-" + osArch
println("platform: " + platformName)
platformName
}
libraryDependencies ++= Seq(
"org.bytedeco" % "javacv" % javacvVersion excludeAll(
ExclusionRule(organization = "org.bytedeco.javacpp-presets"),
ExclusionRule(organization = "org.bytedeco.javacpp")
),
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacppVersion) classifier "",
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacppVersion) classifier platform,
"org.bytedeco" % "javacpp" % javacppVersion,
"org.scala-lang.modules" %% "scala-swing" % "1.0.1",
"net.imagej" % "ij" % "1.49d",
"junit" % "junit" % "4.11" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
"ImageJ Releases" at "http://maven.imagej.net/content/repositories/releases/",
// Use local maven repo for local javacv builds
"Local Maven Repository" at "file:///" + Path.userHome.absolutePath + "/.m2/repository"
)
autoCompilerPlugins := true
// fork a new JVM for 'run' and 'test:run'
fork := true
// add a JVM option to use when forking a JVM for 'run'
javaOptions += "-Xmx1G"
// Set the prompt (for this build) to include the project id.
shellPrompt in ThisBuild := { state => "sbt:" + Project.extract(state).currentRef.project + "> "}