-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.sbt
96 lines (88 loc) · 3.16 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
val ant = "org.apache.ant" % "ant" % "1.9.4"
val apacheCommons = "org.apache.commons" % "commons-lang3" % "3.1"
val commonsIo = "commons-io" % "commons-io" % "1.3.2"
val awsS3 = "com.amazonaws" % "aws-java-sdk-s3" % "1.11.127"
val nscalaTime = "com.github.nscala-time" %% "nscala-time" % "2.4.0"
val gson = "com.google.code.gson" % "gson" % "2.2.3"
val goPluginLibrary = "cd.go.plugin" % "go-plugin-api" % "17.2.0" % Provided
val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.0"
val hamcrest = "org.hamcrest" % "hamcrest-all" % "1.3" % Test
val junit = "junit" % "junit" % "4.12" % Test
val junitInterface = "com.novocode" % "junit-interface" % "0.11" % Test
val mockito = "org.mockito" % "mockito-all" % "1.10.19" % Test
val scalaTest = "org.scalatest" %% "scalatest" % "2.2.0" % Test
val appVersion = sys.env.get("TRAVIS_TAG") orElse sys.env.get("BUILD_LABEL") getOrElse s"1.0.0-${System.currentTimeMillis / 1000}-SNAPSHOT"
lazy val root = Project(
id = "gocd-s3-artifacts",
base = file(".")
) aggregate(utils, publish, material, fetch)
lazy val commonSettings = Seq(
organization := "com.indix",
version := appVersion,
scalaVersion := "2.11.12",
unmanagedBase := file(".") / "lib",
libraryDependencies ++= Seq(
apacheCommons, commonsIo, awsS3, goPluginLibrary, gson, jaxbApi
),
resourceGenerators in Compile += Def.task {
val inputFile = baseDirectory.value / "template" / "plugin.xml"
val outputFile = (resourceManaged in Compile).value / "plugin.xml"
val contents = IO.read(inputFile)
IO.write(outputFile, contents.replaceAll("\\$\\{version\\}", appVersion))
Seq(outputFile)
}.taskValue,
mappings in (Compile, packageBin) += {
(resourceManaged in Compile).value / "plugin.xml" -> "plugin.xml"
},
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
assemblyMergeStrategy in assembly := {
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
lazy val utils = (project in file("utils")).
settings(commonSettings: _*).
settings(
name := "utils",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
junit, junitInterface, mockito
),
resourceGenerators in Compile := Seq()
)
lazy val publish = (project in file("publish")).
dependsOn(utils % "test->test;compile->compile").
settings(commonSettings: _*).
settings(
name := "s3publish",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
ant, junit, junitInterface, mockito
)
)
lazy val material = (project in file("material")).
dependsOn(utils).
settings(commonSettings: _*).
settings(
name := "s3material",
crossPaths := false,
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false),
libraryDependencies ++= Seq(
scalaTest, mockito
)
)
lazy val fetch = (project in file("fetch")).
dependsOn(utils % "test->test;compile->compile").
settings(commonSettings: _*).
settings(
name := "s3fetch",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
junit, mockito
)
)