forked from dvreeze/tqa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
148 lines (115 loc) · 5.63 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// 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}
// Note that 2.12.5 does not work for Scalatest in sbt (https://github.com/scalatest/scalatest/issues/1342).
val scalaVer = "3.0.0"
val crossScalaVer = Seq(scalaVer, "2.13.6")
ThisBuild / description := "Extensible XBRL taxonomy query API"
ThisBuild / organization := "eu.cdevreeze.tqa"
ThisBuild / version := "0.14.0-SNAPSHOT"
ThisBuild / scalaVersion := scalaVer
ThisBuild / crossScalaVersions := crossScalaVer
ThisBuild / semanticdbEnabled := true // enable SemanticDB
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision // only required for Scala 2.x
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 }
// Yaidom, scala-xml, scalactic and scalatest are common dependencies, but "%%%" does not seem to work well for JS now.
// ThisBuild / libraryDependencies += "eu.cdevreeze.yaidom" %%% "yaidom" % "1.13.0"
// ThisBuild / libraryDependencies += "org.scala-lang.modules" %%% "scala-xml" % "2.0.0"
// ThisBuild / libraryDependencies += "org.scalactic" %%% "scalactic" % "3.2.9"
// ThisBuild / libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.9" % Test
lazy val root = project.in(file("."))
.aggregate(tqaJVM, tqaJS)
.settings(
name := "tqa",
// 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 tqa = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("."))
.jvmSettings(
libraryDependencies += "eu.cdevreeze.yaidom" %%% "yaidom" % "1.13.0",
libraryDependencies += "org.scala-lang.modules" %%% "scala-xml" % "2.0.0",
libraryDependencies += "org.scalactic" %%% "scalactic" % "3.2.9",
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.9" % Test,
// This is the HE release of Saxon. You may want to use the EE release instead.
libraryDependencies += "net.sf.saxon" % "Saxon-HE" % "9.9.1-8",
libraryDependencies += "com.github.ben-manes.caffeine" % "caffeine" % "2.9.0",
libraryDependencies += "com.google.code.findbugs" % "jsr305" % "3.0.2", // Why needed?
libraryDependencies += "org.scala-lang.modules" %%% "scala-parallel-collections" % "1.0.3",
mimaPreviousArtifacts := Set("eu.cdevreeze.tqa" %%% "tqa" % "0.12.0")
)
.jsSettings( // Do we need this jsEnv?
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case (Some((3, _))) =>
Seq(
"eu.cdevreeze.yaidom" % "yaidom_sjs1_3" % "1.13.0",
"org.scala-lang.modules" % "scala-xml_sjs1_3" % "2.0.0",
"org.scalactic" % "scalactic_sjs1_3" % "3.2.9",
"org.scalatest" % "scalatest_sjs1_3" % "3.2.9" % Test,
"io.github.cquiroz" % "scala-java-time_sjs1_3" % "2.3.0",
// Hopefully for3Use2_13 soon not needed anymore
"org.scala-js" % "scalajs-dom_sjs1_2.13" % "1.1.0",
// Hopefully for3Use2_13 soon not needed anymore
"com.lihaoyi" % "scalatags_sjs1_2.13" % "0.9.4" % Optional
)
case _ =>
Seq(
"eu.cdevreeze.yaidom" % "yaidom_sjs1_2.13" % "1.13.0",
"org.scala-lang.modules" % "scala-xml_sjs1_2.13" % "2.0.0",
"org.scalactic" % "scalactic_sjs1_2.13" % "3.2.9",
"org.scalatest" % "scalatest_sjs1_2.13" % "3.2.9" % Test,
"io.github.cquiroz" % "scala-java-time_sjs1_2.13" % "2.3.0",
"org.scala-js" % "scalajs-dom_sjs1_2.13" % "1.1.0",
"com.lihaoyi" % "scalatags_sjs1_2.13" % "0.9.4" % Optional
)
}),
Test / parallelExecution := false,
mimaPreviousArtifacts := Set("eu.cdevreeze.tqa" %%% "tqa" % "0.12.0")
)
lazy val tqaJVM = tqa.jvm
lazy val tqaJS = tqa.js
lazy val pomData =
<url>https://github.com/dvreeze/tqa</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>TQA is licensed under Apache License, Version 2.0</comments>
</license>
</licenses>
<scm>
<connection>scm:git:[email protected]:dvreeze/tqa.git</connection>
<url>https://github.com/dvreeze/tqa.git</url>
<developerConnection>scm:git:[email protected]:dvreeze/tqa.git</developerConnection>
</scm>
<developers>
<developer>
<id>dvreeze</id>
<name>Chris de Vreeze</name>
<email>[email protected]</email>
</developer>
</developers>