forked from PurpleKingdomGames/roguelike-starterkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
52 lines (48 loc) · 1.9 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
import scala.sys.process._
import scala.language.postfixOps
Global / onChangedBuildSource := ReloadOnSourceChanges
lazy val roguelike =
(project in file("."))
.enablePlugins(ScalaJSPlugin, SbtIndigo)
.settings(
name := "roguelike",
version := "0.0.1",
scalaVersion := "3.0.1",
organization := "roguelike",
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "0.7.26" % Test
),
testFrameworks += new TestFramework("munit.Framework"),
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
showCursor := true,
title := "Indigo Roguelike!",
gameAssetsDirectory := "assets",
windowStartWidth := 550,
windowStartHeight := 400,
libraryDependencies ++= Seq(
"io.indigoengine" %%% "indigo-json-circe" % "0.9.0",
"io.indigoengine" %%% "indigo" % "0.9.0",
"io.indigoengine" %%% "indigo-extras" % "0.9.0"
)
// scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) } // required for parcel, but will break indigoRun & indigoBuild
)
.settings(
Compile / sourceGenerators += Def.task {
TileCharGen
.gen(
"DfTiles", // Class/module name.
"roguelike", // fully qualified package name
(Compile / sourceManaged).value, // Managed sources (output) directory for the generated classes
10, // Character width
10 // Character height
)
}.taskValue
)
.settings(
code := { "code ." ! }
)
// To use indigoBuild or indigoRun, first comment out the line above that says: `scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }`
addCommandAlias("runGame", ";compile;fastOptJS;indigoRun")
addCommandAlias("buildGame", ";compile;fastOptJS;indigoBuild")
lazy val code =
taskKey[Unit]("Launch VSCode in the current directory")