-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
134 lines (119 loc) · 3.48 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import Dependencies.*
import scala.util.Properties.isMac
ThisBuild / organization := "com.martomate"
ThisBuild / version := "0.14.1"
ThisBuild / scalaVersion := "3.5.1"
ThisBuild / publishArtifact := false
ThisBuild / logBuffered := false
ThisBuild / fork := true
val commonSettings: scala.Seq[Def.Setting[?]] = Defaults.coreDefaultSettings ++ Seq(
artifactName := { (_: ScalaVersion, module: ModuleID, artifact: Artifact) =>
module.organization + "." + module.name + "-" + module.revision + "." + artifact.extension
},
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature"),
javacOptions ++= Seq("-release", "11"),
libraryDependencies += "org.scala-lang" %% "scala2-library-tasty-experimental" % scalaVersion.value
)
lazy val hexacraft = project
.in(file("."))
.aggregate(common, nbt, window, audio, fs, gpu, system, game, client, server, main)
lazy val common = project
.in(file("common"))
.settings(commonSettings*)
.settings(
libraryDependencies ++= Seq(Joml) :+ MUnit
)
lazy val nbt = project
.in(file("nbt"))
.settings(commonSettings*)
.settings(
libraryDependencies ++= Seq(Joml, FlowNbt) :+ MUnit
)
lazy val window = project
.in(file("window"))
.dependsOn(common)
.settings(commonSettings*)
.settings(
libraryDependencies ++= LwjglGlfw :+ MUnit
)
lazy val audio = project
.in(file("audio"))
.dependsOn(common, fs)
.settings(commonSettings*)
.settings(
libraryDependencies ++= LwjglOpenAL ++ LwjglStb :+ MUnit
)
lazy val fs = project
.in(file("fs"))
.dependsOn(common, nbt)
.settings(commonSettings*)
.settings(
libraryDependencies ++= Seq() :+ MUnit
)
lazy val gpu = project
.in(file("gpu"))
.dependsOn(common)
.settings(commonSettings*)
.settings(
libraryDependencies ++= LwjglOpenGL :+ MUnit
)
lazy val system = project
.in(file("system"))
.dependsOn(common)
.settings(commonSettings*)
.settings(
libraryDependencies ++= Seq() :+ MUnit
)
lazy val game = project
.in(file("game"))
.dependsOn(common, nbt, window, fs)
.settings(commonSettings*)
.settings(
libraryDependencies ++= LwjglSystem ++ Seq(Joml, ZeroMQ) ++ Seq(MUnit, Mockito)
)
lazy val client = project
.in(file("client"))
.dependsOn(game, audio, gpu)
.settings(commonSettings*)
.settings(
libraryDependencies ++= Seq(Joml, ZeroMQ) :+ MUnit
)
lazy val server = project
.in(file("server"))
.dependsOn(game % "compile->compile;test->test")
.settings(commonSettings*)
.settings(
libraryDependencies ++= Seq(Joml, ZeroMQ) :+ MUnit
)
lazy val main = project
.in(file("main"))
.dependsOn(
game % "compile->compile;test->test",
client % "compile->compile;test->test",
server,
system
)
.settings(commonSettings*)
.settings( // General
javaOptions ++= (if (isMac) Some("-XstartOnFirstThread") else None)
)
.settings( // Dependencies
libraryDependencies ++= Seq(Joml, ZeroMQ) ++ Seq(MUnit, Mockito) ++ ArchUnit
)
.enablePlugins(PackPlugin)
.settings( // Packaging (using sbt-pack)
moduleName := "hexacraft",
packArchivePrefix := "hexacraft",
packMain := Map(
"hexacraft" -> "hexacraft.main.Main",
"hexacraft-mac" -> "hexacraft.main.Main"
),
packJvmOpts := Map(
"hexacraft" -> Seq(),
"hexacraft-mac" -> Seq("-XstartOnFirstThread")
),
packJarNameConvention := "full",
packGenerateMakefile := false,
packArchiveExcludes := Seq("VERSION", "bin/hexacraft-mac.bat"),
packExcludeJars := Seq(".*scala2-library-tasty.*\\.jar")
)