1
- import sbt .url
2
- import sbtrelease .ReleaseStateTransformations ._
3
-
4
- val scalatestVersion = " 3.0.8"
5
- val scalacticVersion = " 3.0.8"
6
- val enableIfVersion = " 1.1.7"
7
-
8
1
organization in ThisBuild := " net.exoego"
9
2
10
- lazy val commonSettings = Seq (
11
- autoCompilerPlugins := true ,
12
- scalacOptions ++= Seq (
13
- " -deprecation" ,
14
- " -unchecked" ,
15
- " -feature" ,
16
- " -language:implicitConversions" ,
17
- " -Xlint"
18
- ),
19
- scalacOptions in Compile in compile ++= Seq (
20
- " -Xfatal-warnings"
21
- ),
22
- scalacOptions in Compile in doc ++= Seq (
23
- " -Xfatal-warnings" ,
24
- " -no-link-warnings"
25
- ),
26
- autoAPIMappings := true
27
- )
28
- lazy val commonScalaJsSettings = Seq (
29
- scalacOptions += " -P:scalajs:sjsDefinedByDefault" ,
30
- scalaJSModuleKind := ModuleKind .CommonJSModule ,
31
- logBuffered in Test := true
32
- )
33
- lazy val commonMacroParadiseSetting = Seq (
34
- Compile / scalacOptions ++= {
35
- CrossVersion .partialVersion(scalaVersion.value) match {
36
- case Some ((2 , n)) if n >= 13 => " -Ymacro-annotations" :: Nil
37
- case _ => Nil
38
- }
39
- },
40
- libraryDependencies ++= {
41
- CrossVersion .partialVersion(scalaVersion.value) match {
42
- case Some ((2 , n)) if n >= 13 => Nil
43
- case _ => compilerPlugin(" org.scalamacros" % " paradise" % " 2.1.1" cross CrossVersion .full) :: Nil
44
- }
45
- }
46
- )
47
- val nonPublishingSetting = Seq (
48
- skip in publish := true ,
49
- publishArtifact := false ,
50
- publish := {},
51
- publishLocal := {}
52
- )
53
-
54
3
lazy val root = (project in file(" ." ))
55
4
.aggregate(core, current, nodejs_v8)
56
- .settings(commonSettings)
57
- .settings(publishingSettings)
58
- .settings(nonPublishingSetting)
5
+ .settings(MySettings . commonSettings)
6
+ .settings(MySettings . publishingSettings)
7
+ .settings(MySettings . nonPublishingSetting)
59
8
.settings(
60
- name := " scala-js-nodejs-all "
9
+ name := " scala-js-nodejs"
61
10
)
62
11
63
12
lazy val core = (project in file(" ./core" ))
64
13
.enablePlugins(ScalaJSPlugin )
65
- .settings(commonSettings)
66
- .settings(commonScalaJsSettings)
67
- .settings(publishingSettings)
14
+ .settings(MySettings . commonSettings)
15
+ .settings(MySettings . commonScalaJsSettings)
16
+ .settings(MySettings . publishingSettings)
68
17
.settings(
69
18
name := " scala-js-nodejs-core" ,
70
- libraryDependencies ++= Seq (
71
- " org.scala-lang" % " scala-reflect" % scalaVersion.value,
72
- " org.scalatest" %%% " scalatest" % scalatestVersion % " test"
73
- )
19
+ libraryDependencies ++= Dependencies .core.value
74
20
)
75
21
76
22
lazy val compilerSwitches = (project in file(" ./compiler-switches" ))
77
- .settings(commonSettings)
78
- .settings(nonPublishingSetting)
23
+ .settings(MySettings . commonSettings)
24
+ .settings(MySettings . nonPublishingSetting)
79
25
.settings(
80
- libraryDependencies ++= Seq (
81
- " org.scala-lang" % " scala-reflect" % scalaVersion.value
82
- )
26
+ libraryDependencies += Dependencies .scalaReflect.value
83
27
)
84
28
85
29
lazy val current = (project in file(" ./app/current" ))
86
30
.enablePlugins(ScalaJSPlugin )
87
- .settings(commonSettings)
88
- .settings(commonScalaJsSettings)
89
- .settings(commonMacroParadiseSetting)
90
- .settings(publishingSettings)
31
+ .settings(MySettings . commonSettings)
32
+ .settings(MySettings . commonScalaJsSettings)
33
+ .settings(MySettings . commonMacroParadiseSetting)
34
+ .settings(MySettings . publishingSettings)
91
35
.settings(
92
36
scalacOptions ++= Seq (
93
37
" -Xmacro-settings:nodeJs12.5.0"
94
38
),
95
39
name := " scala-js-nodejs-v12" ,
96
- libraryDependencies ++= Seq (
97
- " org.scala-lang" % " scala-reflect" % scalaVersion.value,
98
- " org.scalactic" %% " scalactic" % scalacticVersion,
99
- " org.scalatest" %%% " scalatest" % scalatestVersion % " test" ,
100
- " com.thoughtworks.enableIf" %% " enableif" % enableIfVersion
101
- )
40
+ libraryDependencies ++= Dependencies .app.value
102
41
)
103
42
.dependsOn(core, compilerSwitches)
104
43
105
44
lazy val nodejs_v10 = (project in file(" ./app/nodejs-v10" ))
106
45
.enablePlugins(ScalaJSPlugin )
107
- .settings(commonSettings)
108
- .settings(commonScalaJsSettings)
109
- .settings(commonMacroParadiseSetting)
110
- .settings(publishingSettings)
46
+ .settings(MySettings . commonSettings)
47
+ .settings(MySettings . commonScalaJsSettings)
48
+ .settings(MySettings . commonMacroParadiseSetting)
49
+ .settings(MySettings . publishingSettings)
111
50
.settings(
112
51
unmanagedSourceDirectories in Compile += (baseDirectory in current).value / " src" / " main" / " scala" ,
113
52
scalacOptions ++= Seq (
@@ -116,21 +55,16 @@ lazy val nodejs_v10 = (project in file("./app/nodejs-v10"))
116
55
name := " scala-js-nodejs-v10" ,
117
56
description := " NodeJS v10.16.0 API for Scala.js" ,
118
57
homepage := Some (url(" https://github.com/exoego/scala-js-nodejs" )),
119
- libraryDependencies ++= Seq (
120
- " org.scala-lang" % " scala-reflect" % scalaVersion.value,
121
- " org.scalactic" %% " scalactic" % scalacticVersion,
122
- " org.scalatest" %%% " scalatest" % scalatestVersion % " test" ,
123
- " com.thoughtworks.enableIf" %% " enableif" % enableIfVersion
124
- )
58
+ libraryDependencies ++= Dependencies .app.value
125
59
)
126
60
.dependsOn(core, compilerSwitches)
127
61
128
62
lazy val nodejs_v8 = (project in file(" ./app/nodejs-v8" ))
129
63
.enablePlugins(ScalaJSPlugin )
130
- .settings(commonSettings)
131
- .settings(commonScalaJsSettings)
132
- .settings(commonMacroParadiseSetting)
133
- .settings(publishingSettings)
64
+ .settings(MySettings . commonSettings)
65
+ .settings(MySettings . commonScalaJsSettings)
66
+ .settings(MySettings . commonMacroParadiseSetting)
67
+ .settings(MySettings . publishingSettings)
134
68
.settings(
135
69
unmanagedSourceDirectories in Compile += (baseDirectory in current).value / " src" / " main" / " scala" ,
136
70
scalacOptions ++= Seq (
@@ -139,63 +73,6 @@ lazy val nodejs_v8 = (project in file("./app/nodejs-v8"))
139
73
name := " scala-js-nodejs-v8" ,
140
74
description := " NodeJS v8.16.0 API for Scala.js" ,
141
75
homepage := Some (url(" https://github.com/exoego/scala-js-nodejs" )),
142
- libraryDependencies ++= Seq (
143
- " org.scala-lang" % " scala-reflect" % scalaVersion.value,
144
- " org.scalactic" %% " scalactic" % scalacticVersion,
145
- " org.scalatest" %%% " scalatest" % scalatestVersion % " test" ,
146
- " com.thoughtworks.enableIf" %% " enableif" % enableIfVersion
147
- )
76
+ libraryDependencies ++= Dependencies .app.value
148
77
)
149
78
.dependsOn(core, compilerSwitches)
150
-
151
- lazy val publishingSettings = Seq (
152
- licenses := Seq (" APL2" -> url(" http://www.apache.org/licenses/LICENSE-2.0.txt" )),
153
- scmInfo := Some (
154
- ScmInfo (
155
- url(" https://github.com/exoego/scala-js-nodejs" ),
156
- " scm:git:[email protected] :exoego/scala-js-nodejs.git"
157
- )
158
- ),
159
- homepage := scmInfo.value.map(_.browseUrl),
160
- developers := List (
161
- Developer (
162
- id = " exoego" ,
163
- name = " TATSUNO Yasuhiro" ,
164
-
165
- url = url(" https://www.exoego.net" )
166
- )
167
- ),
168
- publishMavenStyle := true ,
169
- publishArtifact in Test := false ,
170
- publishArtifact in (Compile , packageDoc) := true ,
171
- publishArtifact in (Compile , packageSrc) := true ,
172
- publishArtifact in packageDoc := true ,
173
- pomIncludeRepository := { _ =>
174
- false
175
- },
176
- publishTo := Some (
177
- if (isSnapshot.value)
178
- Opts .resolver.sonatypeSnapshots
179
- else
180
- Opts .resolver.sonatypeStaging
181
- ),
182
- publishConfiguration := publishConfiguration.value.withOverwrite(false ),
183
- publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true ),
184
- releaseIgnoreUntrackedFiles := true ,
185
- releaseProcess := Seq [ReleaseStep ](
186
- checkSnapshotDependencies,
187
- inquireVersions,
188
- runClean,
189
- runTest,
190
- setReleaseVersion,
191
- commitReleaseVersion,
192
- tagRelease,
193
- releaseStepCommandAndRemaining(" +publishSigned" ),
194
- setNextVersion,
195
- commitNextVersion,
196
- releaseStepCommand(" sonatypeReleaseAll" )
197
- )
198
- )
199
-
200
- // loads the Scalajs-io root project at sbt startup
201
- onLoad in Global := (Command .process(" project root" , _ : State )) compose (onLoad in Global ).value
0 commit comments