-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
108 lines (97 loc) · 3.96 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
import sbt._
import Keys._
import IO._
val packageDist = TaskKey[Unit]("package-dist")
val dist = TaskKey[Unit]("dist")
val flyServerVersion = "fly-2.0"
val tests = Seq(
"org.mockito" % "mockito-all" % "1.10.19" % "test->default")
val flyJava = "com.flyobjectspace" % "flyjava" % "2.0.4"
val scalatest = "org.scalatest" %% "scalatest" % "3.0.1" % "test"
val buildSettings: Seq[Setting[_]] = Defaults.defaultSettings ++ Seq[Setting[_]](
organization := "com.flyobjectspace",
version := "2.2.0-SNAPSHOT",
scalaVersion := "2.12.0",
scalacOptions := Seq(
"-target:jvm-1.8",
"-language:_",
// "-Xfatal-warnings",
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
//"-Ywarn-value-discard",
"-Xfuture",
"-Ywarn-unused-import"),
parallelExecution in Test := false,
packageDist <<= (baseDirectory, crossTarget, version, packageBin in Compile, packageDoc in Compile, packageSrc in Compile, streams) map {
(theBase, targetDir, theVersion, jarFile, docFile, srcFile, s) =>
val flyServerZip = theBase / (flyServerVersion + ".zip")
val serverPath = (targetDir / flyServerVersion) ** "*"
val lib = theBase / "lib" * "*"
val libEntries = lib x flat
val docs = theBase / "docs" * "*"
val docEntries = docs x flat
val distribution = theBase / "distribution" * "*"
val distributionEntries = distribution x flat
unzip(flyServerZip, targetDir)
val distPaths = (jarFile +++ docFile +++ srcFile +++ serverPath) x relativeTo(targetDir)
val distZip = targetDir / ("FlyScala-" + theVersion + ".zip")
zip(distPaths ++ docEntries ++ libEntries ++ distributionEntries, distZip)
s.log.info(">>> The distribution is in " + distZip)
},
dist <<= Seq(packageBin in Compile, packageDoc in Compile, packageSrc in Compile, packageDist).dependOn)
def publishSettings: Seq[Setting[_]] = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false},
publishTo <<= version { v: String =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra :=
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license/</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:fly-object-space/fly-scala.git</url>
<connection>scm:git:[email protected]:fly-object-space/fly-scala.git</connection>
</scm>
<url>http://www.flyobjectspace.com</url>
<developers>
<developer>
<id>cjw</id>
<name>Channing Walton</name>
<email>channing [dot] walton [at] underscoreconsulting [dot] com</email>
<organization>Underscore Consulting Ltd</organization>
</developer>
<developer>
<id>nw</id>
<name>Nigel Warren</name>
<organization>Zink Digital Ltd</organization>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>User and Developer Discussion List</name>
<archive>http://groups.google.com/group/flyobjectspace</archive>
<post>[email protected]</post>
<subscribe>[email protected]</subscribe>
<unsubscribe>[email protected]</unsubscribe>
</mailingList>
</mailingLists>)
lazy val flyScala = Project(
"FlyScala",
file("."),
settings = buildSettings ++ publishSettings ++ Seq(resolvers := Seq(Classpaths.typesafeReleases, Resolver.sonatypeRepo("releases")), libraryDependencies ++= tests ++ Seq(flyJava, scalatest)))