|
1 |
| -import sbtcrossproject.CrossPlugin.autoImport.crossProject |
2 |
| - |
3 |
| -inThisBuild(Seq( |
4 |
| - name := "Scala DOM Types", |
5 |
| - normalizedName := "domtypes", |
6 |
| - organization := "com.raquo", |
7 |
| - scalaVersion := "2.12.12", |
8 |
| - crossScalaVersions := Seq("2.11.12", "2.12.12", "2.13.4") |
9 |
| -)) |
10 |
| - |
11 |
| -// @TODO[WTF] Why can't this be inside releaseSettings? |
12 |
| -releaseCrossBuild := true |
13 |
| - |
14 |
| -// @TODO[SBT] How to extract these shared settings into a separate release.sbt file? |
15 |
| -lazy val releaseSettings = Seq( |
16 |
| - homepage := Some(url("https://github.com/raquo/scala-dom-types")), |
17 |
| - licenses += ("MIT", url("https://github.com/raquo/scala-dom-types/blob/master/LICENSE.md")), |
18 |
| - scmInfo := Some( |
19 |
| - ScmInfo( |
20 |
| - url("https://github.com/raquo/scala-dom-types"), |
21 |
| - "scm:git@github.com/raquo/scala-dom-types.git" |
| 1 | +ThisBuild / scalaVersion := ScalaVersions.v213 |
| 2 | +ThisBuild / crossScalaVersions := Seq(ScalaVersions.v3RC1, ScalaVersions.v213, ScalaVersions.v212, ScalaVersions.v211) |
| 3 | + |
| 4 | +lazy val domtypes = |
| 5 | + crossProject(JSPlatform, JVMPlatform).in(file(".")) |
| 6 | + .settings( |
| 7 | + scalacOptions ~= (_.filterNot(Set( |
| 8 | + "-Wunused:params", |
| 9 | + "-Ywarn-unused:params", |
| 10 | + "-Wunused:explicits" |
| 11 | + ))), |
| 12 | + scalacOptions in (Compile, doc) ~= (_.filter(_.startsWith("-Xplugin"))), |
| 13 | + scalacOptions in (Compile, doc) ++= Seq( |
| 14 | + "-no-link-warnings" // Suppress scaladoc "Could not find any member to link for" warnings |
| 15 | + ) |
22 | 16 | )
|
23 |
| - ), |
24 |
| - developers := List( |
25 |
| - Developer( |
26 |
| - id = "raquo", |
27 |
| - name = "Nikita Gazarov", |
28 |
| - email = "nikita@raquo.com", |
29 |
| - url = url("http://raquo.com") |
| 17 | + .jsSettings( |
| 18 | + scalaJSLinkerConfig ~= { _.withSourceMap(false) }, |
| 19 | + libraryDependencies ++= Seq( |
| 20 | + ("org.scala-js" %%% "scalajs-dom" % "1.1.0").withDottyCompat(scalaVersion.value) |
| 21 | + ) |
30 | 22 | )
|
31 |
| - ), |
32 |
| - sonatypeProfileName := "com.raquo", |
33 |
| - publishMavenStyle := true, |
34 |
| - publishArtifact in Test := false, |
35 |
| - publishTo := sonatypePublishTo.value, |
36 |
| - releaseCrossBuild := true, |
37 |
| - pomIncludeRepository := { _ => false }, |
38 |
| - useGpg := false, |
39 |
| - releasePublishArtifactsAction := PgpKeys.publishSigned.value |
40 |
| -) |
41 |
| - |
42 | 23 |
|
43 |
| -val baseScalacSettings = |
44 |
| - "-encoding" :: "UTF-8" :: |
45 |
| - "-unchecked" :: |
46 |
| - "-deprecation" :: |
47 |
| - "-explaintypes" :: |
48 |
| - "-feature" :: |
49 |
| - "-language:_" :: |
50 |
| - "-Xfuture" :: |
51 |
| - "-Xlint" :: |
52 |
| - "-Yno-adapted-args" :: |
53 |
| - "-Ywarn-value-discard" :: |
54 |
| - "-Ywarn-unused" :: |
55 |
| - Nil |
56 |
| - |
57 |
| -lazy val scalacSettings = Seq( |
58 |
| - scalacOptions ++= { |
59 |
| - CrossVersion.partialVersion(scalaVersion.value) match { |
60 |
| - case Some((2, 13)) => |
61 |
| - baseScalacSettings.diff( |
62 |
| - "-Xfuture" :: |
63 |
| - "-Yno-adapted-args" :: |
64 |
| - "-Ywarn-infer-any" :: |
65 |
| - "-Ywarn-nullary-override" :: |
66 |
| - "-Ywarn-nullary-unit" :: |
67 |
| - Nil |
68 |
| - ) |
69 |
| - case _ => baseScalacSettings |
70 |
| - } |
71 |
| - } |
| 24 | +lazy val noPublish = Seq( |
| 25 | + publishLocal / skip := true, |
| 26 | + publish / skip := true, |
| 27 | + publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo"))) |
72 | 28 | )
|
73 | 29 |
|
74 |
| -lazy val commonSettings = releaseSettings ++ scalacSettings |
75 |
| - |
76 |
| -lazy val root = project.in(file(".")) |
77 |
| - .aggregate(domtypesJS, domtypesJVM) |
78 |
| - .settings(commonSettings) |
79 |
| - .settings( |
80 |
| - skip in publish := true |
81 |
| - ) |
82 |
| - |
83 |
| -lazy val domtypes = crossProject(JSPlatform, JVMPlatform).in(file(".")) |
84 |
| - .settings(commonSettings) |
85 |
| - .jsConfigure(_.enablePlugins(ScalaJSBundlerPlugin)) |
86 |
| - .jsSettings( |
87 |
| - scalaJSLinkerConfig ~= { _.withSourceMap(false) }, |
88 |
| - requireJsDomEnv in Test := true, |
89 |
| - useYarn := true, |
90 |
| - libraryDependencies ++= Seq( |
91 |
| - "org.scala-js" %%% "scalajs-dom" % "1.0.0" |
| 30 | +lazy val root = |
| 31 | + project.in(file(".")) |
| 32 | + .aggregate(domtypes.js, domtypes.jvm) |
| 33 | + .settings(noPublish) |
| 34 | + .settings( |
| 35 | + name := "Scala DOM Types" |
92 | 36 | )
|
93 |
| - ) |
94 |
| - |
95 |
| -lazy val domtypesJS = domtypes.js |
96 |
| -lazy val domtypesJVM = domtypes.jvm |
0 commit comments