-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sbt
executable file
·129 lines (116 loc) · 4.89 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
import ScalaWebTestBuild._
import scala.xml.transform.RewriteRule
lazy val supportedScalaVersions = Seq("2.13.3", "2.12.12")
val projectVersion = "4.0.1-SNAPSHOT"
val scalaTestVersion = "3.2.9"
val scalaTestSeleniumVersion = "3.2.0.0"
val seleniumVersion = "3.141.59"
val htmlUnitVersion = "2.41.0"
val slf4jVersion = "1.7.28"
val playJsonVersion = "2.9.0"
val versions = Map("scalaWebTest" -> projectVersion, "scalaTest" -> scalaTestVersion, "selenium" -> seleniumVersion, "htmlUnit" -> htmlUnitVersion, "playJson" -> playJsonVersion)
val scalaWebTestSeries = "4.0.0"
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(publishArtifact := false)
.settings(crossScalaVersions := Nil)
.disablePlugins(MimaPlugin)
.aggregate(core, aem, json, bom, integration_test)
lazy val commonSettings = Seq(
organization := "org.scalawebtest",
version := projectVersion,
scalaVersion := "2.13.3",
scalacOptions := Seq("-unchecked", "-deprecation", "-Xfatal-warnings"),
publishMavenStyle := true,
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")
},
pomIncludeRepository := { _ => false },
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.8",
pomExtra := scalaWebTestPomExtra,
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % scalaWebTestSeries)
)
lazy val core = Project(id = "scalawebtest-core", base = file("scalawebtest-core"))
.settings(commonSettings: _*)
.settings(crossScalaVersions := supportedScalaVersions)
.settings(
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion,
"org.scalatestplus" %% "selenium-3-141" % scalaTestSeleniumVersion,
"org.seleniumhq.selenium" % "selenium-java" % seleniumVersion,
"org.seleniumhq.selenium" % "htmlunit-driver" % htmlUnitVersion,
"org.jsoup" % "jsoup" % "1.13.1",
"org.slf4j" % "slf4j-api" % slf4jVersion,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.6"
)
)
lazy val aem = Project(id = "scalawebtest-aem", base = file("scalawebtest-aem"))
.settings(commonSettings: _*)
.settings(crossScalaVersions := supportedScalaVersions)
.settings(libraryDependencies += "com.typesafe.play" %% "play-json" % playJsonVersion)
.dependsOn(core)
lazy val json = Project(id = "scalawebtest-json", base = file("scalawebtest-json"))
.settings(commonSettings: _*)
.settings(crossScalaVersions := supportedScalaVersions)
.settings(libraryDependencies += "com.typesafe.play" %% "play-json" % playJsonVersion)
.dependsOn(core)
lazy val bom = Project(id = "scalawebtest-bom", base = file("scalawebtest-bom"))
.settings(description := "ScalaWebTest (Bill of Materials)")
.settings(commonSettings: _*)
.settings(crossScalaVersions := supportedScalaVersions)
.settings(
publishArtifact in(Compile, packageBin) := false,
publishArtifact in(Compile, packageDoc) := false,
publishArtifact in(Compile, packageSrc) := false)
.settings(
pomExtra := pomExtra.value ++ scalaVersion(bomDependencies(versions)).value
)
.settings(pomPostProcess := { (node: scala.xml.Node) =>
val rewriteRule: RewriteRule =
new scala.xml.transform.RewriteRule {
override def transform(n: scala.xml.Node): scala.xml.NodeSeq = {
val name = n.nameToString(new StringBuilder).toString
if (name == "dependencies") {
scala.xml.NodeSeq.Empty
}
else if (name == "dependencyManagementDependencies") {
<dependencies>
{n.child}
</dependencies>
}
else {
n
}
}
}
val transformer = new scala.xml.transform.RuleTransformer(rewriteRule)
transformer.transform(node).head
})
.disablePlugins(MimaPlugin)
lazy val integration_test = Project(id = "scalawebtest-integration", base = file("scalawebtest-integration"))
.configs(IntegrationTest)
.settings(Defaults.itSettings: _*)
.settings(commonSettings: _*)
.settings(crossScalaVersions := supportedScalaVersions)
.settings(
libraryDependencies ++= Seq(
"javax.servlet" % "javax.servlet-api" % "4.0.1" % "provided",
"org.scalatest" %% "scalatest" % scalaTestVersion % "it",
"org.seleniumhq.selenium" % "selenium-java" % seleniumVersion % "it",
"org.seleniumhq.selenium" % "htmlunit-driver" % htmlUnitVersion % "it",
"org.slf4j" % "slf4j-api" % slf4jVersion % "it",
"org.slf4j" % "slf4j-simple" % slf4jVersion % "it",
"com.typesafe.play" %% "play-json" % playJsonVersion % "it"
)
)
.disablePlugins(MimaPlugin)
.enablePlugins(JettyPlugin)
.settings(containerPort in Jetty := 9090)
.dependsOn(core)
.dependsOn(aem)
.dependsOn(json)
addCommandAlias("inttest", "; jetty:start ; it:test ; jetty:stop")