This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
107 lines (98 loc) · 3.58 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
import Dependencies._
import Publishing._
/* The base, minimal settings for every project, including the root aggregate project */
val BaseSettings = Seq(
organization := "com.tapad.sbt",
licenses += ("BSD New", url("https://opensource.org/licenses/BSD-3-Clause")),
scalaVersion := Dependencies.ScalaVersion
)
/* Common settings for all non-aggregate subprojects */
val CommonSettings = BaseSettings ++ Seq(
scalacOptions ++= Seq("-deprecation", "-language:_"),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % ScalaTestVersion % "test"
)
)
val PluginSettings = CommonSettings ++ scriptedSettings ++ Seq(
sbtPlugin := true,
scriptedLaunchOpts ++= Seq("-Xmx1024M", "-XX:MaxPermSize=256M", "-Dplugin.version=" + version.value),
scriptedBufferLog := false
)
lazy val root = (project in file("."))
.settings(BaseSettings: _*)
.settings(NoopPublishingSettings: _*)
.settings(ReleaseSettings: _*)
.aggregate(plugin, library, util, templating, templatingLibrary)
.enablePlugins(CrossPerProjectPlugin)
lazy val plugin = (project in file("plugin"))
.settings(PluginSettings: _*)
.settings(PluginPublishingSettings: _*)
.settings(
name := "sbt-oozie",
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.7.25",
"org.slf4j" % "slf4j-jdk14" % "1.7.25" % "test"
),
publishLocal := {
(publishLocal.dependsOn(publishLocal in library).dependsOn(publishLocal in util)).value
},
addSbtPlugin("com.tapad.sbt" % "sbt-hadoop" % "0.2.0")
)
.dependsOn(library, util)
lazy val library = (project in file("library"))
.settings(CommonSettings: _*)
.settings(LibraryPublishingSettings: _*)
.settings(
name := "oozie-lib",
libraryDependencies ++= Seq(
"org.apache.oozie" % "oozie-client" % "4.3.0" exclude ("org.slf4j", "slf4j-simple"),
"org.scalactic" %% "scalactic" % ScalacticVersion
),
libraryDependencies := scalaXml(scalaVersion.value).fold(libraryDependencies.value) {
libraryDependencies.value :+ _
}
)
lazy val util = (project in file("util"))
.settings(CommonSettings: _*)
.settings(LibraryPublishingSettings: _*)
.settings(
name := "oozie-util",
libraryDependencies := parserCombinators(scalaVersion.value).fold(libraryDependencies.value) {
libraryDependencies.value :+ _
}
)
lazy val templating = (project in file("templating-plugin"))
.settings(PluginSettings: _*)
.settings(PluginPublishingSettings: _*)
.settings(
name := "sbt-oozie-templating",
buildInfoKeys := Seq[BuildInfoKey](version),
buildInfoPackage := "sbtoozie",
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.3"),
sourceDirectories in (Compile, TwirlKeys.compileTemplates) += {
(resourceDirectory in Compile).value / "templates"
},
TwirlKeys.templateFormats ++= Map(
"sh" -> "play.twirl.api.TxtFormat"
),
publishLocal := {
(publishLocal.dependsOn(publishLocal in plugin)).value
},
publishLocal := {
(publishLocal.dependsOn(publishLocal in templatingLibrary)).value
}
)
.dependsOn(plugin, templatingLibrary)
.enablePlugins(BuildInfoPlugin, SbtTwirl)
lazy val templatingLibrary = (project in file("templating-library"))
.settings(CommonSettings: _*)
.settings(LibraryPublishingSettings: _*)
.settings(
name := "oozie-templating-lib",
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.slf4j" % "slf4j-api" % "1.7.25",
"com.typesafe.play" %% "twirl-api" % "1.3.3" % "provided"
),
parallelExecution in test := false
)