Skip to content

Commit

Permalink
SBT: update resolvers, add isCI
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Dec 11, 2024
1 parent 953cd5f commit a0e3e65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "16"
Expand Down
10 changes: 7 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def allScalaVersions = scala2Versions :+ scala3
def scalajsBinaryVersion = "1"
def scalajsDom = "2.0.0"

def isCI = System.getenv("CI") != null

def isScala2(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2)
def isScala212(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) && v.exists(_._2 == 12)
def isScala213(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) && v.exists(_._2 == 13)
Expand Down Expand Up @@ -78,7 +80,7 @@ def crossSetting[A](
inThisBuild(
List(
version ~= { dynVer =>
if (System.getenv("CI") != null) dynVer
if (isCI) dynVer
else {
import scala.sys.process._
// drop `v` prefix
Expand Down Expand Up @@ -108,9 +110,11 @@ inThisBuild(
),
testFrameworks := List(new TestFramework("munit.Framework")),
resolvers ++= Resolver.sonatypeOssRepos("public"),
resolvers ++= Resolver.sonatypeOssRepos("releases"),
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
// faster publishLocal:
packageDoc / publishArtifact := "true" == System.getenv("CI"),
packageSrc / publishArtifact := "true" == System.getenv("CI"),
packageDoc / publishArtifact := isCI,
packageSrc / publishArtifact := isCI,
turbo := true,
useSuperShell := false // overlaps with MUnit test failure reports.
)
Expand Down

0 comments on commit a0e3e65

Please sign in to comment.