-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sbt
More file actions
155 lines (124 loc) · 5.12 KB
/
build.sbt
File metadata and controls
155 lines (124 loc) · 5.12 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// scalastyle:off
// *** Settings ***
useGpg := false
lazy val commonSettings = Seq(
organization := "org.scala-rules",
organizationHomepage := Some(url("https://github.com/scala-rules")),
homepage := Some(url("https://github.com/scala-rules/rule-engine")),
version := "0.5.2-SNAPSHOT",
scalaVersion := "2.11.8",
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-Xlint", "-Xfatal-warnings")
) ++ staticAnalysisSettings ++ publishSettings
// *** Projects ***
lazy val ruleEngineRoot = (project in file("."))
.settings(commonSettings: _*)
.settings(
name := "scala-rules",
description := "Scala Rules"
)
.aggregate(engineCore, engine, engineTestUtils)
lazy val engineCore = (project in file("engine-core"))
.settings(commonSettings: _*)
.settings(
name := "rule-engine-core",
description := "Rule Engine Core",
libraryDependencies ++= engineCoreDependencies
)
lazy val engine = (project in file("engine"))
.settings(commonSettings: _*)
.settings(
name := "rule-engine",
description := "Rule Engine",
libraryDependencies ++= engineDependencies,
addCompilerPlugin(
"org.scalameta" % "paradise" % "3.0.0.95" cross CrossVersion.full ),
scalacOptions += "-Xplugin-require:macroparadise",
resolvers += Resolver.url(
"scalameta-bintray",
url("https://dl.bintray.com/scalameta/maven"))(Resolver.ivyStylePatterns)
)
.dependsOn(engineCore)
lazy val engineTestUtils = (project in file("engine-test-utils"))
.settings(commonSettings: _*)
.settings(
name := "rule-engine-test-utils",
description := "Rule Engine Test Utils",
libraryDependencies ++= testUtilDependencies
)
.dependsOn(engine)
// *** Dependencies ***
lazy val scalaTestVersion = "2.2.5"
lazy val jodaTimeVersion = "2.4"
lazy val jodaConvertVersion = "1.8"
lazy val commonDependencies = Seq(
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.7.2",
"com.fasterxml.jackson.jaxrs" % "jackson-jaxrs-json-provider" % "2.7.3",
"joda-time" % "joda-time" % jodaTimeVersion,
"org.joda" % "joda-convert" % jodaConvertVersion,
"org.scalameta" %% "scalameta" % "1.2.0",
"org.scala-rules" %% "finance-dsl" % "0.1.0",
"org.scalatest" %% "scalatest" % scalaTestVersion % Test,
"org.scalacheck" %% "scalacheck" % "1.12.5" % Test
)
lazy val engineCoreDependencies = commonDependencies
lazy val engineDependencies = commonDependencies
lazy val testUtilDependencies = Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion
) ++ commonDependencies
// *** Static analysis ***
lazy val staticAnalysisSettings = {
lazy val compileScalastyle = taskKey[Unit]("Runs Scalastyle on production code")
lazy val testScalastyle = taskKey[Unit]("Runs Scalastyle on test code")
Seq(
scalastyleConfig in Compile := (baseDirectory in ThisBuild).value / "project" / "scalastyle-config.xml",
scalastyleConfig in Test := (baseDirectory in ThisBuild).value / "project" / "scalastyle-test-config.xml",
// The line below is needed until this issue is fixed: https://github.com/scalastyle/scalastyle-sbt-plugin/issues/44
scalastyleConfig in scalastyle := (baseDirectory in ThisBuild).value / "project" / "scalastyle-test-config.xml",
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value,
testScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Test).toTask("").value
)
}
coverageExcludedPackages := ".*Macros"
// Temporarily disabling scalastyle and coverage because they choke on scala meta macros
// TODO : Extract the macros to their own subproject and disable these things there
//addCommandAlias("verify", ";compileScalastyle;testScalastyle;coverage;test;coverageReport;coverageAggregate")
addCommandAlias("verify", ";testScalastyle;test")
addCommandAlias("release", ";clean;compile;publishSigned")
// *** Publishing ***
lazy val publishSettings = Seq(
pomExtra := pom,
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
licenses := Seq("MIT License" -> url("http://www.opensource.org/licenses/mit-license.php")),
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")
}
)
lazy val pom =
<developers>
<developer>
<name>Vincent Zorge</name>
<email>scala-rules@linuse.nl</email>
<organization>Linuse</organization>
<organizationUrl>https://github.com/vzorge</organizationUrl>
</developer>
<developer>
<name>Jan-Hendrik Kuperus</name>
<email>jan-hendrik@scala-rules.org</email>
<organization>Yoink Development</organization>
<organizationUrl>http://www.yoink.nl</organizationUrl>
</developer>
<developer>
<name>Nathan Perdijk</name>
<email>nathan@scala-rules.org</email>
</developer>
</developers>
<scm>
<connection>scm:git:git@github.com:scala-rules/rule-engine.git</connection>
<developerConnection>scm:git:git@github.com:scala-rules/rule-engine.git</developerConnection>
<url>git@github.com:scala-rules/rule-engine.git</url>
</scm>