-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
119 lines (111 loc) · 3.46 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
import Dependencies.d
import PropertiesHelper._
lazy val EndToEndTest = config("e2e") extend(Test)
lazy val webappDir = settingKey[File]("The webapp directory for the container")
lazy val commonConfig: Project=>Project = configure (_) (
/* Project information */ _.settings(
organization := "org.merizen"
, name := "hipconf"
, version := "0.1-SNAPSHOT"
)
, /* Scala compiler configuration */ _.settings(
scalaVersion := "2.11.4"
, scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
)
, /* Where to look for library dependencies */ _.settings(
resolvers += Resolver.mavenLocal
)
)
lazy val root = configure(project in file("."))(
commonConfig
, /* Project information */ _.settings(
name := "hipconf"
)
, /* Library dependencies */ _.settings(
libraryDependencies ++=
forConfiguration(Compile
, d.lift.webkit
, d.lift.squerylRecord
, d.h2
, d.liquibaseCore
, d.snakeYaml
, d.logbackClassic
, d.commonsIo
, d.jquery
, d.normalizeCss
)
++ forConfiguration("test,it,e2e"
, d.cucumber.core
, d.cucumber.junit
, d.cucumber.scala
, d.cucumber.pro
, d.junit
, d.junitInterface
, d.seleniumJava
, d.scalatest
, d.jetty.webapp
, d.jetty.plus
)
++ forConfiguration(Provided
, d.servletApi
)
++ forConfiguration(Runtime
, d.groovy
)
)
, /* Shared definitions */ _.settings(
webappDir := (sourceDirectory in Compile).value / "webapp"
)
, /* Shared test helpers */ _.dependsOn(
testHelpers % "test,it,e2e"
).aggregate(
testHelpers
).settings(Defaults.itSettings: _*
).settings(inConfig(EndToEndTest)(Defaults.testSettings): _*
).settings(
unmanagedResourceDirectories in Test += baseDirectory.value / "features"
, unmanagedResourceDirectories in IntegrationTest += baseDirectory.value / "features"
, unmanagedResourceDirectories in EndToEndTest += baseDirectory.value / "features"
).configs(
IntegrationTest
, EndToEndTest
)
, /* Container configuration (for container:start etc) */
_.settings(jetty(libs = Seq((d.jetty.runner % "container").intransitive)): _*)
, /* Make location of webapp dir available to selenium tests */ _.settings(
resourceGenerators in Test += Def.task {
val file = (resourceManaged in Test).value / "webapp.properties"
writeProperties(file, Map("webappDir" -> webappDir.value.toString))
Seq(file)
}.taskValue
)
, /* Jrebel configuration (needs path to jrebel.jar) */ if (!sys.env.contains("JREBEL_PATH")) identity else _.settings(
jrebel.webLinks += webappDir.value
, javaOptions in container ++= Seq(
"-javaagent:" + sys.env("JREBEL_PATH")
, "-noverify"
, "-XX:+UseConcMarkSweepGC"
, "-XX:+CMSClassUnloadingEnabled"
)
)
.settings(jrebelSettings: _*)
)
lazy val testHelpers = configure(project)(
commonConfig
, /* Project information */ _.settings(
name := "hipconf-test-helpers"
)
, /* Library dependencies */ _.settings(
libraryDependencies ++=
forConfiguration(Compile
, d.cucumber.core
, d.cucumber.scala
, d.junit
)
)
)
def configure(p: Project)(cs: (Project => Project)*) = cs.reduce(_ andThen _)(p)
def forConfiguration(c: Configuration, deps: ModuleID*) =
deps map (_ % c)
def forConfiguration(cs: String, deps: ModuleID*) =
deps map (_ % cs)