Skip to content

Commit b2c14f8

Browse files
authored
Merge pull request #184 from zeotuan/main
Only publish core(spark-fast-test) module (#21)
2 parents 06c071b + 1517498 commit b2c14f8

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

build.sbt

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1+
val versionRegex = """^(.*)\.(.*)\.(.*)$""".r
2+
val scala2_13 = "2.13.14"
3+
val scala2_12 = "2.12.20"
4+
val sparkVersion = System.getProperty("spark.version", "3.5.3")
5+
val noPublish = Seq(
6+
(publish / skip) := true,
7+
publishArtifact := false
8+
)
9+
110
inThisBuild(
211
List(
312
organization := "com.github.mrpowers",
413
homepage := Some(url("https://github.com/mrpowers-io/spark-fast-tests")),
514
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
615
developers ++= List(
716
Developer("MrPowers", "Matthew Powers", "@MrPowers", url("https://github.com/MrPowers"))
8-
)
17+
),
18+
Compile / scalafmtOnCompile := true,
19+
Test / fork := true,
20+
crossScalaVersions := {
21+
sparkVersion match {
22+
case versionRegex("3", m, _) if m.toInt >= 2 => Seq(scala2_12, scala2_13)
23+
case versionRegex("3", _, _) => Seq(scala2_12)
24+
}
25+
},
26+
scalaVersion := crossScalaVersions.value.head
927
)
1028
)
1129

1230
enablePlugins(GitVersioning)
13-
Compile / scalafmtOnCompile := true
14-
15-
name := "spark-fast-tests"
16-
17-
val versionRegex = """^(.*)\.(.*)\.(.*)$""".r
18-
19-
val scala2_13 = "2.13.14"
20-
val scala2_12 = "2.12.20"
21-
22-
val sparkVersion = System.getProperty("spark.version", "3.5.3")
23-
crossScalaVersions := {
24-
sparkVersion match {
25-
case versionRegex("3", m, _) if m.toInt >= 2 => Seq(scala2_12, scala2_13)
26-
case versionRegex("3", _, _) => Seq(scala2_12)
27-
}
28-
}
29-
30-
scalaVersion := crossScalaVersions.value.head
31-
32-
Test / fork := true
3331

3432
lazy val commonSettings = Seq(
3533
javaOptions ++= {
@@ -46,7 +44,8 @@ lazy val commonSettings = Seq(
4644
lazy val core = (project in file("core"))
4745
.settings(
4846
commonSettings,
49-
name := "core",
47+
moduleName := "spark-fast-tests",
48+
name := moduleName.value,
5049
Compile / packageSrc / publishArtifact := true,
5150
Compile / packageDoc / publishArtifact := true
5251
)
@@ -58,9 +57,9 @@ lazy val benchmarks = (project in file("benchmarks"))
5857
libraryDependencies ++= Seq(
5958
"org.openjdk.jmh" % "jmh-generator-annprocess" % "1.37" // required for jmh IDEA plugin. Make sure this version matches sbt-jmh version!
6059
),
61-
name := "benchmarks",
62-
publish / skip := true
60+
name := "benchmarks"
6361
)
62+
.settings(noPublish)
6463
.enablePlugins(JmhPlugin)
6564

6665
lazy val docs = (project in file("docs"))
@@ -111,14 +110,22 @@ lazy val docs = (project in file("docs"))
111110
import laika.format.Markdown
112111
Seq(Markdown.GitHubFlavor, SyntaxHighlighting)
113112
},
114-
publish / skip := true,
115113
Laika / sourceDirectories := Seq((ThisBuild / baseDirectory).value / "docs")
116114
)
115+
.settings(noPublish)
116+
117+
lazy val root = (project in file("."))
118+
.settings(
119+
name := "spark-fast-tests-root",
120+
commonSettings,
121+
noPublish
122+
)
123+
.aggregate(core, benchmarks, docs)
117124

118125
scmInfo := Some(ScmInfo(url("https://github.com/mrpowers-io/spark-fast-tests"), "[email protected]:MrPowers/spark-fast-tests.git"))
119126

120127
updateOptions := updateOptions.value.withLatestSnapshots(false)
121128

122129
import xerial.sbt.Sonatype.sonatypeCentralHost
123130

124-
ThisBuild / sonatypeCredentialHost := sonatypeCentralHost
131+
ThisBuild / sonatypeCredentialHost := sonatypeCentralHost

0 commit comments

Comments
 (0)