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-
81organization in ThisBuild := " net.exoego"
92
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-
543lazy val root = (project in file(" ." ))
554 .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)
598 .settings(
60- name := " scala-js-nodejs-all "
9+ name := " scala-js-nodejs"
6110 )
6211
6312lazy val core = (project in file(" ./core" ))
6413 .enablePlugins(ScalaJSPlugin )
65- .settings(commonSettings)
66- .settings(commonScalaJsSettings)
67- .settings(publishingSettings)
14+ .settings(MySettings . commonSettings)
15+ .settings(MySettings . commonScalaJsSettings)
16+ .settings(MySettings . publishingSettings)
6817 .settings(
6918 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
7420 )
7521
7622lazy val compilerSwitches = (project in file(" ./compiler-switches" ))
77- .settings(commonSettings)
78- .settings(nonPublishingSetting)
23+ .settings(MySettings . commonSettings)
24+ .settings(MySettings . nonPublishingSetting)
7925 .settings(
80- libraryDependencies ++= Seq (
81- " org.scala-lang" % " scala-reflect" % scalaVersion.value
82- )
26+ libraryDependencies += Dependencies .scalaReflect.value
8327 )
8428
8529lazy val current = (project in file(" ./app/current" ))
8630 .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)
9135 .settings(
9236 scalacOptions ++= Seq (
9337 " -Xmacro-settings:nodeJs12.5.0"
9438 ),
9539 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
10241 )
10342 .dependsOn(core, compilerSwitches)
10443
10544lazy val nodejs_v10 = (project in file(" ./app/nodejs-v10" ))
10645 .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)
11150 .settings(
11251 unmanagedSourceDirectories in Compile += (baseDirectory in current).value / " src" / " main" / " scala" ,
11352 scalacOptions ++= Seq (
@@ -116,21 +55,16 @@ lazy val nodejs_v10 = (project in file("./app/nodejs-v10"))
11655 name := " scala-js-nodejs-v10" ,
11756 description := " NodeJS v10.16.0 API for Scala.js" ,
11857 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
12559 )
12660 .dependsOn(core, compilerSwitches)
12761
12862lazy val nodejs_v8 = (project in file(" ./app/nodejs-v8" ))
12963 .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)
13468 .settings(
13569 unmanagedSourceDirectories in Compile += (baseDirectory in current).value / " src" / " main" / " scala" ,
13670 scalacOptions ++= Seq (
@@ -139,63 +73,6 @@ lazy val nodejs_v8 = (project in file("./app/nodejs-v8"))
13973 name := " scala-js-nodejs-v8" ,
14074 description := " NodeJS v8.16.0 API for Scala.js" ,
14175 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
14877 )
14978 .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