-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.sbt
76 lines (63 loc) · 2.64 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
val zioVersion = "2.0.21"
val seleniumVersion = "4.27.0"
val htmlUnitDriverVersion = "4.13.0"
ThisBuild / scalaVersion := "2.13.16"
ThisBuild / scalacOptions += "-Wunused:imports"
ThisBuild / organization := "dev.doamaral"
ThisBuild / organizationName := "doamaral"
ThisBuild / organizationHomepage := Some(url("https://github.com/dylandoamaral"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/dylandoamaral/zio-selenium"),
"scm:[email protected]:dylandoamaral/zio-selenium.git"
)
)
ThisBuild / developers := List(
Developer(
id = "ddoamaral",
name = "Dylan DO AMARAL",
email = "[email protected]",
url = url("https://www.dylan.doamaral.dev/")
)
)
ThisBuild / description := "A ZIO wrapper to interact with a browser using Selenium."
ThisBuild / licenses := List("Apache 2" -> new URL("https://github.com/dylandoamaral/zio-selenium/blob/master/LICENSE"))
ThisBuild / homepage := Some(url("https://github.com/dylandoamaral/zio-selenium"))
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / version ~= addVersionPadding
ThisBuild / coverageExcludedPackages := ".*zio.selenium.example.*"
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
lazy val root =
(project in file("."))
.settings(
name := "zio-selenium",
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test",
"org.seleniumhq.selenium" % "selenium-java" % seleniumVersion,
"org.seleniumhq.selenium" % "htmlunit-driver" % htmlUnitDriverVersion
),
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
Test / parallelExecution := false
)
addCommandAlias("check", "; scalafmtCheckAll; scalafixAll --check;")
/**
* Add padding to change: 0.1.0+48-bfcea99ap20220317-1157-SNAPSHOT into
* 0.1.0+0048-bfcea99ap20220317-1157-SNAPSHOT. It helps to retrieve the
* latest snapshots from
* https://oss.sonatype.org/#nexus-search;gav~dev.doamaral~zio-selenium_2.13~~~~kw,versionexpand.
*/
def addVersionPadding(baseVersion: String): String = {
import scala.util.matching.Regex
val paddingSize = 5
val counter: Regex = "\\+([0-9]+)-".r
counter.findFirstMatchIn(baseVersion) match {
case Some(regex) =>
val count = regex.group(1)
val snapshotNumber = "0" * (paddingSize - count.length) + count
counter.replaceFirstIn(baseVersion, s"+$snapshotNumber-")
case None => baseVersion
}
}