This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
113 lines (85 loc) · 3.94 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
// Building both for JVM and JavaScript runtimes.
// To convince SBT not to publish any root level artifacts, I had a look at how scala-java-time does it.
// See https://github.com/cquiroz/scala-java-time/blob/master/build.sbt as a "template" for this build file.
// shadow sbt-scalajs' crossProject and CrossType from Scala.js 0.6.x
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
val scalaVer = "3.0.0"
val crossScalaVer = Seq(scalaVer, "2.13.6")
ThisBuild / description := "Extensible XML query API with multiple DOM-like implementations, 2nd generation"
ThisBuild / organization := "eu.cdevreeze.yaidom2"
ThisBuild / version := "0.14.0-SNAPSHOT"
ThisBuild / scalaVersion := scalaVer
ThisBuild / crossScalaVersions := crossScalaVer
ThisBuild / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case (Some((3, _))) =>
Seq("unchecked", "-source:3.0-migration")
case _ =>
Seq("-Wconf:cat=unused-imports:w,cat=unchecked:w,cat=deprecation:w,cat=feature:w,cat=lint:w", "-Ytasty-reader", "-Xsource:3")
})
ThisBuild / Test / publishArtifact := false
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) {
Some("snapshots" at nexus + "content/repositories/snapshots")
} else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
}
ThisBuild / pomExtra := pomData
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / libraryDependencies += "org.scala-lang.modules" %%% "scala-xml" % "2.0.0"
ThisBuild / libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.9" % Test
ThisBuild / libraryDependencies += "org.scalatestplus" %%% "scalacheck-1-15" % "3.2.9.0" % Test
lazy val root = project.in(file("."))
.aggregate(yaidom2JVM, yaidom2JS)
.settings(
name := "yaidom2",
// Thanks, scala-java-time, for showing us how to prevent any publishing of root level artifacts:
// No, SBT, we don't want any artifacts for root. No, not even an empty jar.
publish := {},
publishLocal := {},
publishArtifact := false,
Keys.`package` := file(""))
lazy val yaidom2 = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("."))
.jvmSettings(
// By all means, override this version of Saxon if needed, possibly with a Saxon-EE release!
libraryDependencies += "net.sf.saxon" % "Saxon-HE" % "9.9.1-8",
libraryDependencies += "org.scalacheck" %%% "scalacheck" % "1.15.4" % Test,
libraryDependencies += "org.typelevel" %%% "cats-core" % "2.6.1" % Test,
libraryDependencies += "org.typelevel" %%% "cats-free" % "2.6.1" % Test,
mimaPreviousArtifacts := Set("eu.cdevreeze.yaidom2" %%% "yaidom2" % "0.12.0")
)
.jsSettings(
// Do we need this jsEnv?
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
libraryDependencies += ("org.scala-js" %%% "scalajs-dom" % "1.1.0").cross(CrossVersion.for3Use2_13), // Hopefully soon not needed anymore
Test / parallelExecution := false,
mimaPreviousArtifacts := Set("eu.cdevreeze.yaidom2" %%% "yaidom2" % "0.12.0")
)
lazy val yaidom2JVM = yaidom2.jvm
lazy val yaidom2JS = yaidom2.js
lazy val pomData =
<url>https://github.com/dvreeze/yaidom2</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>Yaidom2 is licensed under Apache License, Version 2.0</comments>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:dvreeze/yaidom2.git</connection>
<url>https://github.com/dvreeze/yaidom2.git</url>
<developerConnection>scm:git:git@github.com:dvreeze/yaidom2.git</developerConnection>
</scm>
<developers>
<developer>
<id>dvreeze</id>
<name>Chris de Vreeze</name>
<email>chris.de.vreeze@caiway.net</email>
</developer>
</developers>