-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
77 lines (67 loc) · 2.74 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
import sbt.Keys._
import sbt._
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
libraryDependencies ++= Seq(
"org.rogach" %% "scallop" % "2.0.2",
"ch.qos.logback" % "logback-classic" % "1.1.7",
"com.typesafe.scala-logging" %% "scala-logging" % "3.5.0",
"com.diogonunes" % "JCDP" % "2.0.1",
"com.lihaoyi" %% "upickle" % "0.4.3", // % "test",
"com.lihaoyi" %% "ammonite-ops" % "0.8.0", // % "test",
"org.scalactic" %% "scalactic" % "3.0.0",
"org.scalatest" %% "scalatest" % "3.0.0" % "test"
)
name := "weaponmark"
version := "1.1-BETA"
scalaVersion in ThisBuild := "2.11.8"
maintainer := "Paul L. Bryan"
packageSummary := "Attack benchmarking tool for Mage: The Ascension (2nd Edition, WW4600)"
packageDescription := "Attack benchmark tool for Mage: The Ascension"
//mainClass in Compile := Some("WeaponMark")
assemblyJarName in assembly := "weaponmark-assembly.jar"
assemblyOutputPath in assembly := baseDirectory.value / ("target/universal/jdkpackager/lib/" + (assemblyJarName in assembly).value)
// remove "app" directory from root, sbt-native-packager:
// http://sbt-native-packager.readthedocs.io/en/latest/formats/universal.html#universal-plugin
//topLevelDirectory := None
scalacOptions ++= List(
// "-unchecked",
// "-Xdisable-assertions",
"-language:_",
"-encoding", "UTF-8",
"-deprecation", // warns on use of deprecated api's
"-Xfatal-warnings", // compile fails if any warnings occur - keep code clean
"-Xfuture", // turn on future language features
"-feature" // provide warning info about misused language features
)
// for sbt-dependency-graph
filterScalaLibrary := true
javaOptions in Universal ++= Seq(
//"-java-home C:/Program Files/Java/jre1.8.0_111/bin"
)
lazy val iconGlob = sys.props("os.name").toLowerCase match {
case os if os.contains("mac") ⇒ "*.icns"
case os if os.contains("win") ⇒ "*.ico"
case _ ⇒ "*.png"
}
jdkAppIcon := (sourceDirectory.value ** iconGlob).getPaths.headOption.map(file)
jdkPackagerType := "exe" //"installer"
// removes all jar mappings in universal and appends the fat jar
mappings in Universal := {
// universalMappings: Seq[(File,String)]
val universalMappings = (mappings in Universal).value
val fatJar = (assembly in Compile).value
// removing means filtering
val filtered = universalMappings filter {
case (file, name) => !name.endsWith(".jar") && !name.contains("launcher")
}
// add the fat jar
filtered :+ (fatJar -> ("lib/" + fatJar.getName))
}
lazy val root = (project in file(".")).
//enablePlugins(JDKPackagerPlugin).
enablePlugins(UniversalPlugin).
enablePlugins(BuildInfoPlugin).
settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "weaponmark"
)