Skip to content

Commit

Permalink
Run cross-build, don't break Scala 2 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
keynmol committed Sep 1, 2022
1 parent eaec152 commit 21bf5d0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
java-version: 8
- name: JVM tests
if: matrix.platform == 'jvm'
run: sbt core/test
run: sbt +core/test
- name: JS tests
if: matrix.platform == 'js'
run: sbt coreJS/test
run: sbt +coreJS/test
- name: Native tests
if: matrix.platform == 'native'
run: sbt coreNative/test
run: sbt +coreNative/test

publish:
needs: test
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BuildHelper._

def scala3Version = "3.1.3"
def scala2Version = "2.13.9"
def scala2Version = "2.13.8"
def munitVersion = "1.0.0-M6"
def projectName = "scala-yaml"
def localSnapshotVersion = "0.0.5-SNAPSHOT"
Expand Down
43 changes: 24 additions & 19 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,32 @@ import sbt.Keys._

object BuildHelper {
lazy val docsSettings = Seq(
Compile / doc / scalacOptions ++= Seq(
"-project",
"Scala-yaml",
"-siteroot",
"docs",
"-project-version",
version.value,
"-project-logo",
"docs/logo.svg",
"-social-links:" +
"github::https://github.com/VirtusLab/scala-yaml," +
"twitter::https://twitter.com/VirtusLab",
"-project-footer",
s"Copyright (c) 2021, VirtusLab",
"-source-links:github://VirtusLab/scala-yaml",
"-revision",
"master"
),
Compile / doc / scalacOptions ++= {
if (scalaBinaryVersion.value.startsWith("3")) {
Seq(
"-project",
"Scala-yaml",
"-siteroot",
"docs",
"-project-version",
version.value,
"-project-logo",
"docs/logo.svg",
"-social-links:" +
"github::https://github.com/VirtusLab/scala-yaml," +
"twitter::https://twitter.com/VirtusLab",
"-project-footer",
s"Copyright (c) 2021, VirtusLab",
"-source-links:github://VirtusLab/scala-yaml",
"-revision",
"master"
)
} else Seq.empty
},
Compile / doc := {
val out = (Compile / doc).value
IO.copyDirectory((Compile / doc / target).value, file("generated-docs"))
if (scalaBinaryVersion.value.startsWith("3"))
IO.copyDirectory((Compile / doc / target).value, file("generated-docs"))
out
}
)
Expand Down

0 comments on commit 21bf5d0

Please sign in to comment.