This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
120 lines (94 loc) · 4.2 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
// scalastyle:off
// *** Settings ***
useGpg := false
lazy val commonSettings = Seq(
organization := "nl.rabobank.rules",
organizationHomepage := Some(url("https://github.com/rabobank-nederland")),
homepage := Some(url("https://github.com/rabobank-nederland/rule-rest")),
version := "0.1.0-SNAPSHOT",
scalaVersion := "2.11.8",
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-Xlint", "-Xfatal-warnings")
) ++ staticAnalysisSettings ++ publishSettings
// *** Projects ***
lazy val ruleRest = (project in file("."))
.settings(commonSettings: _*)
.settings(
name := "rule-rest",
description := "Rabo Rules REST Service",
libraryDependencies ++= dependencies
)
.enablePlugins(PlayScala, UniversalDeployPlugin)
// *** Dependencies ***
lazy val raboRulesVersion = "0.6.0"
lazy val scalaTestVersion = "3.0.0"
lazy val jodaTimeVersion = "2.4"
lazy val jodaConvertVersion = "1.8"
lazy val dependencies = Seq(
"nl.rabobank.rules" %% "rule-engine" % raboRulesVersion,
"joda-time" % "joda-time" % jodaTimeVersion,
"org.joda" % "joda-convert" % jodaConvertVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % Test,
"org.scalacheck" %% "scalacheck" % "1.12.5" % Test,
"com.storm-enroute" %% "scalameter" % "0.7" % Test,
filters
)
// *** 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
)
}
addCommandAlias("verify", ";compileScalastyle;testScalastyle;coverage;test;coverageReport;coverageAggregate")
addCommandAlias("release", ";clean;compile;publishLocal;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")
}
)
val packageDist = taskKey[File]("package-dist")
packageDist := (baseDirectory in Compile).value / "target" / "universal" / (name.value + "-" + version.value + ".tgz")
artifact in (Universal, packageDist) ~= { (art:Artifact) => art.copy(`type` = "tgz", extension = "tgz") }
addArtifact(artifact in (Universal, packageDist), packageDist in Universal)
publish <<= (publish) dependsOn (packageZipTarball in Universal)
publishM2 <<= (publishM2) dependsOn (packageZipTarball in Universal)
publishLocal <<= (publishLocal) dependsOn (packageZipTarball in Universal)
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:rabobank-nederland/rule-rest.git</connection>
<developerConnection>scm:git:git@github.com:rabobank-nederland/rule-rest.git</developerConnection>
<url>git@github.com:rabobank-nederland/rule-rest.git</url>
</scm>