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