This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.sbt
141 lines (116 loc) · 3.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
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
import sbtcrossproject.CrossPlugin.autoImport.crossProject
val specs2 = "org.specs2" %% "specs2-core" % "4.8.1" % Test
val scalaTest = "org.scalatest" %% "scalatest" % "3.1.0" % Test
val scalaTestPlus = "org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test
val scalaTestJunit = "org.scalatestplus" %% "scalatestplus-junit" % "1.0.0-M2"
val scalaTestMockito = "org.scalatestplus" %% "scalatestplus-mockito" % "1.0.0-M2"
val junit = "junit" % "junit" % "4.12" % Test
val mockito = "org.mockito" % "mockito-core" % "3.1.0" % "test"
def projectId(state: State) = extracted(state).currentProject.id
def extracted(state: State) = Project extract state
lazy val root = project
.in(file("."))
.settings(name := "scala-dddbase")
.settings(commonSettings: _*)
.aggregate(
coreJS,
coreJVM,
forwardingJS,
forwardingJVM,
memoryJVM,
memoryJS,
specJVM,
specJS
)
lazy val commonSettings = Seq(
sonatypeProfileName := "org.sisioh",
organization := "org.sisioh",
scalaVersion := "2.13.1",
crossScalaVersions := Seq("2.11.7", "2.12.8", "2.13.1"),
scalacOptions ++= Seq("-feature", "-unchecked", "-deprecation"),
shellPrompt := {
"sbt (%s)> " format projectId(_)
},
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
},
pomExtra := (
<url>https://github.com/sisioh/scala-dddbase</url>
<licenses>
<license>
<name>Apache License Version 2.0</name>
<url>http://www.apache.org/licenses/</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:sisioh/scala-dddbase.git</url>
<connection>scm:git:[email protected]:sisioh/scala-dddbase.git</connection>
</scm>
<developers>
<developer>
<id>j5ik2o</id>
<name>Junichi Kato</name>
<url>http://j5ik2o.me</url>
</developer>
</developers>
),
publishTo in ThisBuild := sonatypePublishTo.value,
Global / useGpg := false,
credentials := {
val ivyCredentials = (baseDirectory in LocalRootProject).value / ".credentials"
Credentials(ivyCredentials) :: Nil
}
)
lazy val jvmCommonSettings = Seq(
libraryDependencies ++= Seq(
"org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided",
mockito,
specs2,
scalaTest,
junit,
scalaTestPlus,
scalaTestJunit,
scalaTestMockito
)
)
lazy val jsCommonSettings = Seq(
scalaJSOutputMode := org.scalajs.core.tools.linker.backend.OutputMode.ECMAScript6
)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.in(file("scala-dddbase-core"))
.settings(name := "scala-dddbase-core")
.settings(commonSettings: _*)
.jvmSettings(jvmCommonSettings: _*)
.jsSettings(jsCommonSettings: _*)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val forwarding = crossProject(JSPlatform, JVMPlatform)
.in(file("scala-dddbase-lifecycle-repositories-forwarding"))
.settings(name := "scala-dddbase-lifecycle-repositories-forwarding")
.settings(commonSettings: _*)
.jvmSettings(jvmCommonSettings: _*)
.jsSettings(jsCommonSettings: _*)
.dependsOn(core)
lazy val forwardingJVM = forwarding.jvm
lazy val forwardingJS = forwarding.js
lazy val memory = crossProject(JSPlatform, JVMPlatform)
.in(file("scala-dddbase-lifecycle-repositories-memory"))
.settings(name := "scala-dddbase-lifecycle-repositories-memory")
.settings(commonSettings: _*)
.jvmSettings(jvmCommonSettings: _*)
.jsSettings(jsCommonSettings: _*)
.dependsOn(core, forwarding)
lazy val memoryJVM = memory.jvm
lazy val memoryJS = memory.js
lazy val spec = crossProject(JSPlatform, JVMPlatform)
.in(file("scala-dddbase-spec"))
.settings(name := "scala-dddbase-spec")
.settings(commonSettings: _*)
.jvmSettings(jvmCommonSettings: _*)
.jsSettings(jsCommonSettings: _*)
.dependsOn(core, forwarding)
lazy val specJVM = spec.jvm
lazy val specJS = spec.js