-
Notifications
You must be signed in to change notification settings - Fork 443
/
build.sbt
138 lines (121 loc) · 5.15 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name := "sbt-native-packager"
organization := "com.github.sbt"
homepage := Some(url("https://github.com/sbt/sbt-native-packager"))
Global / onChangedBuildSource := ReloadOnSourceChanges
Global / scalaVersion := "2.12.20"
// crossBuildingSettings
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.1.6"
case _ => "2.0.0-M2"
}
}
scriptedSbt := {
scalaBinaryVersion.value match {
case "2.12" => "1.10.5"
case _ => "2.0.0-M2"
}
}
Compile / scalacOptions ++= Seq("-deprecation")
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
// put jdeb on the classpath for scripted tests
classpathTypes += "maven-plugin"
libraryDependencies ++= Seq(
// these dependencies have to be explicitly added by the user
"com.spotify" % "docker-client" % "8.16.0" % Provided,
"org.vafer" % "jdeb" % "1.12" % Provided artifacts Artifact("jdeb", "jar", "jar"),
"org.apache.commons" % "commons-compress" % "1.27.1",
// for jdkpackager
"org.apache.ant" % "ant" % "1.10.15",
// workaround for the command line size limit
"com.github.eldis" % "tool-launcher" % "0.2.2",
"org.scalatest" %% "scalatest" % "3.2.19" % Test
)
// sbt dependent libraries
libraryDependencies ++= {
(pluginCrossBuild / sbtVersion).value match {
case v if v.startsWith("1.") =>
Seq("org.scala-sbt" %% "io" % "1.10.0")
case _ => Seq()
}
}
// scala version depended libraries
libraryDependencies ++= {
scalaBinaryVersion.value match {
case "2.10" => Nil
case _ =>
Seq(
// Do NOT upgrade these dependencies to 2.x or newer! sbt-native-packager is a sbt-plugin
// and gets published with Scala 2.12, therefore we need to stay at the same major version
// like the 2.12.x Scala compiler, otherwise we run into conflicts when using sbt 1.5+
// See https://github.com/scala/scala/pull/9743
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2", // Do not upgrade beyond 1.x
"org.scala-lang.modules" %% "scala-xml" % "2.2.0"
)
}
}
// configure github page
enablePlugins(SphinxPlugin, SiteScaladocPlugin, GhpagesPlugin, SbtPlugin)
git.remoteRepo := {
sys.env.get("GITHUB_TOKEN") match {
case Some(token) => s"https://x-access-token:[email protected]/sbt/sbt-native-packager"
case None => "[email protected]:sbt/sbt-native-packager.git"
}
}
// scripted test settings
scriptedLaunchOpts += "-Dproject.version=" + version.value
// binary compatibility settings
mimaPreviousArtifacts := {
val m = "com.typesafe.sbt" %% moduleName.value % "1.3.15"
val sbtBinV = (pluginCrossBuild / sbtBinaryVersion).value
val scalaBinV = (update / scalaBinaryVersion).value
if (scalaBinV == "2.10") {
println(s"Skip MiMa check for SBT binary version ${sbtBinV} as scala ${scalaBinV} is not supported")
Set.empty
} else
Set(Defaults.sbtPluginExtra(m cross CrossVersion.disabled, sbtBinV, scalaBinV))
}
// Release configuration
publishMavenStyle := true
// project meta data
licenses := Seq("BSD-2-Clause" -> url("https://opensource.org/licenses/BSD-2-Clause"))
homepage := Some(url("https://github.com/sbt/sbt-native-packager"))
scmInfo := Some(
ScmInfo(url("https://github.com/sbt/sbt-native-packager"), "scm:[email protected]:sbt/sbt-native-packager.git")
)
developers := List(
Developer(
id = "muuki88",
name = "Nepomuk Seiler",
email = "[email protected]",
url = url("https://github.com/muuki88")
),
Developer(id = "jsuereth", name = "Josh Suereth", email = "jsuereth", url = url("https://github.com/jsuereth"))
)
addCommandAlias("scalafmtFormatAll", "; ^scalafmtAll ; scalafmtSbt")
// ci commands
addCommandAlias("validateFormatting", "; scalafmtCheckAll ; scalafmtSbtCheck")
addCommandAlias("validate", "; clean ; update ; validateFormatting ; test ; mimaReportBinaryIssues")
// List all scripted test separately to schedule them in different travis-ci jobs.
// Travis-CI has hard timeouts for jobs, so we run them in smaller jobs as the scripted
// tests take quite some time to run.
// Ultimately we should run only those tests that are necessary for a change
addCommandAlias("validateUniversal", "scripted universal/*")
addCommandAlias("validateJar", "scripted jar/*")
addCommandAlias("validateBash", "scripted bash/*")
addCommandAlias("validateAsh", "scripted ash/*")
addCommandAlias("validateGraalVMNativeImage", "scripted graalvm-native-image/*")
addCommandAlias("validateRpm", "scripted rpm/*")
addCommandAlias("validateDebian", "scripted debian/*")
addCommandAlias("validateDocker", "scripted docker/*")
addCommandAlias("validateJdkPackager", "scripted jdkpackager/*")
// travis ci's jdk8 version doesn't support nested association elements.
// error: Caused by: class com.sun.javafx.tools.ant.Info doesn't support the nested "association" element.
addCommandAlias(
"validateJdkPackagerTravis",
"scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings"
)
addCommandAlias("validateMacOS", "; validate ; validateUniversal")
addCommandAlias("validateWindows", "; testOnly * -- -n windows ; scripted universal/dist universal/stage windows/*")
addCommandAlias("validateJlink", "scripted jlink/*")
addCommandAlias("ci-release", "release with-defaults")