forked from chobeat/scala-game-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
131 lines (112 loc) · 4.17 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
import sbtcrossproject.{crossProject, CrossType}
val scalaVer = "2.12.0"
val scalaNativeVer = "2.11.8"
lazy val commonSettings = Seq(
version := "0.0.1",
scalaVersion := scalaVer,
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
)
lazy val commonNativeSettings = Seq(
scalaVersion := scalaNativeVer
)
lazy val root = (project in file("."))
.settings(
name := "sgl",
sourcesInBase := false
)
.settings(commonSettings: _*)
.aggregate(html5, desktopAWT, desktopNative, jvmShared, coreJS, coreJVM, coreNative)
lazy val core = (crossProject(JSPlatform, JVMPlatform, NativePlatform).crossType(CrossType.Pure) in file("./core"))
.settings(commonSettings: _*)
.settings(name := "sgl-core")
.nativeSettings(scalaVersion := scalaNativeVer)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val coreNative = core.native
lazy val jvmShared = (project in file("./jvm-shared"))
.settings(commonSettings: _*)
.dependsOn(coreJVM)
lazy val desktopAWT = (project in file("./desktop-awt"))
.settings(commonSettings: _*)
.settings(
name := "sgl-desktop-awt",
libraryDependencies += "com.googlecode.soundlibs" % "tritonus-share" % "0.3.7-3",
libraryDependencies += "com.googlecode.soundlibs" % "vorbisspi" % "1.0.3-2",
libraryDependencies += "com.googlecode.soundlibs" % "jorbis" % "0.0.17-3",
libraryDependencies += "net.liftweb" %% "lift-json" % "3.1.1"
)
.dependsOn(coreJVM, jvmShared)
lazy val desktopNative = (project in file("./desktop-native"))
.enablePlugins(ScalaNativePlugin)
.settings(commonSettings: _*)
.settings(commonNativeSettings: _*)
.settings(
name := "sgl-desktop-native",
libraryDependencies ++= List(
"com.regblanc" %%% "native-sdl2" % "0.1",
"com.regblanc" %%% "native-sdl2-image" % "0.1",
"com.regblanc" %%% "native-sdl2-ttf" % "0.1",
"com.regblanc" %%% "native-opengl" % "0.1"
)
)
.dependsOn(coreNative)
lazy val html5 = (project in file("./html5"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings: _*)
.settings(
name := "sgl-html5",
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.1"
)
.dependsOn(coreJS)
//Android cannot run on Java8 so we stick with 2.11. We
//need to build core separately for the right version
/*
val scalaAndroidVer = "2.11.8"
val commonAndroidSettings = Seq(
scalaVersion := scalaAndroidVer,
scalacOptions += "-target:jvm-1.7",
javacOptions ++= Seq("-source", "1.7", "-target", "1.7"),
exportJars := true
)
lazy val coreAndroid = (project in file("./core"))
.settings(commonSettings: _*)
.settings(commonAndroidSettings: _*)
.settings(
name := "sgl-core",
target := baseDirectory.value / ".android" / "target"
)
lazy val jvmSharedAndroid = (project in file("./jvm-shared"))
.settings(commonSettings: _*)
.settings(commonAndroidSettings: _*)
.settings(
target := baseDirectory.value / ".android" / "target"
)
.dependsOn(coreAndroid)
lazy val android = (project in file("./android"))
.enablePlugins(AndroidLib)
.settings(commonSettings: _*)
.settings(commonAndroidSettings: _*)
.settings(
name := "sgl-android",
libraryDependencies += "com.google.firebase" % "firebase-core" % "9.0.0",
libraryDependencies += "com.google.android.gms" % "play-services-ads" % "9.0.0",
libraryDependencies += "com.google.android.gms" % "play-services-drive" % "9.0.0",
libraryDependencies += "com.google.android.gms" % "play-services-games" % "9.0.0",
libraryDependencies += "com.google.android.gms" % "play-services-plus" % "9.0.0",
libraryDependencies += "com.google.android.gms" % "play-services-analytics" % "9.0.0",
useProguard := true,
proguardOptions ++= Seq(
"-dontobfuscate",
"-dontoptimize",
"-keepattributes Signature",
"-dontwarn scala.collection.**", // required from Scala 2.11.3
"-dontwarn scala.collection.mutable.**", // required from Scala 2.11.0
"-ignorewarnings",
"-keep class scala.Dynamic",
"-keep class scala.concurrent.*",
"-keep class test.**"
),
platformTarget := "android-23"
)
.dependsOn(coreAndroid, jvmSharedAndroid)
*/