forked from suzaku-io/diode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
165 lines (146 loc) · 4.37 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import sbt._
import Keys._
import com.typesafe.sbt.pgp.PgpKeys._
crossScalaVersions := Seq("2.11.8")
val commonSettings = Seq(
organization := "me.chrons",
version := Version.library,
scalaVersion := "2.11.8",
scalacOptions := Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Yinline-warnings",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture"),
scalacOptions in Compile -= "-Ywarn-value-discard",
scalacOptions in (Compile, doc) -= "-Xfatal-warnings",
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "utest" % "0.4.3" % "test"
)
)
val publishSettings = Seq(
scmInfo := Some(ScmInfo(
url("https://github.com/ochrons/diode"),
"scm:git:[email protected]:ochrons/diode.git",
Some("scm:git:[email protected]:ochrons/diode.git"))),
publishMavenStyle := true,
publishArtifact in Test := false,
pomExtra :=
<url>https://github.com/ochrons/diode</url>
<licenses>
<license>
<name>MIT license</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<developers>
<developer>
<id>ochrons</id>
<name>Otto Chrons</name>
<url>https://github.com/ochrons</url>
</developer>
</developers>,
pomIncludeRepository := { _ => false },
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
)
val sourceMapSetting =
Def.setting(
if (isSnapshot.value) Seq.empty
else Seq({
val a = baseDirectory.value.toURI.toString.replaceFirst("[^/]+/?$", "")
val g = "https://raw.githubusercontent.com/ochrons/diode"
s"-P:scalajs:mapSourceURI:$a->$g/v${version.value}/${name.value}/"
})
)
def preventPublication(p: Project) =
p.settings(
publish :=(),
publishLocal :=(),
publishSigned :=(),
publishLocalSigned :=(),
publishArtifact := false,
publishTo := Some(Resolver.file("Unused transient repository", target.value / "fakepublish")),
packagedArtifacts := Map.empty)
lazy val diodeCore = crossProject.in(file("diode-core"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "diode-core"
)
.jsSettings(
scalacOptions ++= sourceMapSetting.value,
scalaJSUseRhino in Global := false
)
.jvmSettings()
lazy val diodeCoreJS = diodeCore.js
lazy val diodeCoreJVM = diodeCore.jvm
lazy val diodeData = crossProject.in(file("diode-data"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "diode-data"
)
.jsSettings(
scalacOptions ++= sourceMapSetting.value,
scalaJSUseRhino in Global := false
)
.jvmSettings()
.dependsOn(diodeCore)
lazy val diodeDataJS = diodeData.js
lazy val diodeDataJVM = diodeData.jvm
lazy val diode = crossProject
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "diode"
)
.dependsOn(diodeCore, diodeData)
lazy val diodeJS = diode.js
lazy val diodeJVM = diode.jvm
lazy val diodeDevtools = crossProject.in(file("diode-devtools"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "diode-devtools"
)
.jsSettings(
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.0"
),
scalacOptions ++= sourceMapSetting.value,
scalaJSUseRhino in Global := false
)
.jvmSettings()
.dependsOn(diodeCore)
lazy val diodeDevToolsJS = diodeDevtools.js
lazy val diodeDevToolsJVM = diodeDevtools.jvm
lazy val diodeReact = project.in(file("diode-react"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "diode-react",
libraryDependencies ++= Seq(
"com.github.japgolly.scalajs-react" %%% "core" % "0.11.1"
),
scalaJSUseRhino in Global := false,
scalacOptions ++= sourceMapSetting.value
)
.dependsOn(diodeJS)
.enablePlugins(ScalaJSPlugin)
lazy val root = preventPublication(project.in(file(".")))
.settings()
.aggregate(diodeJS, diodeJVM, diodeCoreJS, diodeCoreJVM, diodeDataJS, diodeDataJVM, diodeReact, diodeDevToolsJS, diodeDevToolsJVM)