forked from tobyweston/temperature-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sbt
47 lines (34 loc) · 1.61 KB
/
package.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
enablePlugins(JavaServerAppPackaging, DebianPlugin, JDebPackaging, SystemdPlugin)
maintainer := "Toby Weston <[email protected]>"
packageSummary := "temperature data logger based on the DS18B20 sensor"
packageDescription := """Homebrew temperature data logger based on the DS18B20 sensor."""
debianPackageDependencies in Debian ++= Seq("oracle-java8-jdk")
// don't package JavaDoc or source
mappings in (Compile, packageDoc) := Seq()
mappings in (Compile, packageSrc) := Seq()
// todo add a mapping from /var/log/temperature-machine/xxx.log to symlink /home/pi/.temperature/temperature-machine.log
daemonUser in Linux := "pi"
linuxPackageMappings := {
val mappings = linuxPackageMappings.value
mappings map { mapping =>
val filtered = mapping.mappings filter {
case (file, _) => !(file.getName == "temperature-machine.1.md")
case _ => true
}
mapping.copy(mappings = filtered)
} filter {
_.mappings.nonEmpty
}
}
// filter out jar files from the list of generated files
mappings in Universal := (mappings in Universal).value.
filter {
case (_, name) => !name.endsWith(".jar")
}
// append the proguard jar file
mappings in Universal ++= (proguard in Proguard).value.map(jar => jar -> ("lib/" + jar.getName))
// point the classpath to the output from the proguard task
scriptClasspath := (proguard in Proguard).value.map(jar => jar.getName)
// add some custom stuff to the startup scripts
bashScriptExtraDefines ++= IO.readLines(sourceDirectory.value / "universal" / "conf" / "find_ip.sh")
bashScriptExtraDefines += """addJava "-Djava.rmi.server.hostname=$(getIpAddress)""""