-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.sbt
152 lines (126 loc) · 5.52 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
* Copyright (c) 2019 - Convergence Labs, Inc.
*
* This file is part of the Convergence Server, which is released under
* the terms of the GNU General Public License version 3 (GPLv3). A copy
* of the GPLv3 should have been provided along with this file, typically
* located in the "LICENSE" file, which is part of this source code package.
* Alternatively, see <https://www.gnu.org/licenses/gpl-3.0.html> for the
* full text of the GPLv3 license, if it was not provided.
*/
import Dependencies.Compile._
import Dependencies.Test._
import com.jsuereth.sbtpgp.PgpKeys._
//
// Global Settings
//
Global / onChangedBuildSource := ReloadOnSourceChanges
ThisBuild / resolvers += Resolver.sonatypeRepo("snapshots")
ThisBuild / organization := "com.convergencelabs"
ThisBuild / organizationName := "Convergence Labs, Inc."
ThisBuild / organizationHomepage := Some(url("https://convergencelabs.com"))
ThisBuild / homepage := Some(url("https://convergence.io"))
ThisBuild / licenses += "GPLv3" -> url("https://www.gnu.org/licenses/gpl-3.0.html")
ThisBuild / scmInfo := Some(ScmInfo(
url("https://github.com/convergencelabs/convergence-server"),
"https://github.com/convergencelabs/convergence-server.git"))
ThisBuild / scalaVersion := "2.13.7"
ThisBuild / developers := List(
Developer(
id = "mmacfadden",
name = "Michael MacFadden",
email = "[email protected]",
url = url("https://convergencelabs.com")
)
)
//
// ExhaustiveOtTest
//
lazy val ExhaustiveOtTest = Configuration.of("OT", "ot") extend Test
lazy val otTestConfig = Defaults.configSettings ++ Defaults.testTasks ++ Seq(
ExhaustiveOtTest / scalaSource := baseDirectory.value / "src" / "test-ot" / "scala",
ExhaustiveOtTest / parallelExecution := false
)
lazy val exhaustiveOtTestSettings =
inConfig(ExhaustiveOtTest)(otTestConfig)
//
// Root Project
//
lazy val root = (project in file("."))
.configs(ExhaustiveOtTest)
.settings(
exhaustiveOtTestSettings ++
Seq(
name := "Convergence Server",
normalizedName := "convergence-server",
description := "The Convergence Server core classes.",
scalacOptions := Seq("-deprecation", "-feature"),
Compile / discoveredMainClasses := Seq(),
fork := true,
libraryDependencies ++=
akkaCore ++
orientDb ++
loggingAll ++
Seq(
scalapb,
convergenceProto,
akkaHttp,
json4s,
jacksonYaml,
json4sExt,
akkaHttpJson4s,
akkaHttpCors,
commonsLang,
jose4j,
bouncyCastle,
scrypt,
netty,
javaWebsockets,
scallop,
parboiled
) ++
Seq(orientDbServer % "test") ++
testingCore ++
testingAkka,
//
// SBT Build Info
//
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "com.convergencelabs.convergence.server"
))
.enablePlugins(BuildInfoPlugin)
.enablePlugins(OrientDBPlugin)
//
// Universal Distribution Project
//
// Create some dummy tasks to help us publish the universal distribution.
val packageZip = taskKey[File]("package-zip")
val packageTgz = taskKey[File]("package-tgz")
lazy val dist = (project in file("distribution"))
.enablePlugins(JavaAppPackaging, UniversalDeployPlugin)
.settings(Seq(
name := "Convergence Server Universal Distribution",
normalizedName := "convergence-server-universal",
description := "The universal binary distribution of the Convergence Server.",
maintainer := "[email protected]",
crossPaths := false,
Compile / discoveredMainClasses := Seq(),
executableScriptName := "convergence-server",
Compile / mainClass := Some("com.convergencelabs.convergence.server.ConvergenceServer"),
bashScriptExtraDefines += """addApp "-c ${app_home}/../conf/convergence-server.conf"""",
bashScriptExtraDefines += """addJava "-Dlog4j.configurationFile=${app_home}/../conf/log4j2.xml"""",
bashScriptExtraDefines += """addJava "-Dnashorn.args=--no-deprecation-warning"""",
batScriptExtraDefines += """call :add_app "-c %APP_HOME%\conf\convergence-server.conf"""",
batScriptExtraDefines += """call :add_java "-Dlog4j.configurationFile=%APP_HOME%\conf\log4j2.xml"""",
batScriptExtraDefines += """call :add_java "-Dnashorn.args=--no-deprecation-warning"""",
packageZip := (Compile / baseDirectory).value / "target" / "universal" / (normalizedName.value + "-" + version.value + ".zip"),
Universal / packageZip / artifact ~= { (art: Artifact) => art.withType("zip").withExtension("zip") },
packageTgz := (Compile / baseDirectory).value / "target" / "universal" / (normalizedName.value + "-" + version.value + ".tgz"),
Universal / packageTgz / artifact ~= { (art: Artifact) => art.withType("tgz").withExtension("tgz") },
publish := (publish dependsOn(Universal / packageBin, Universal / packageZipTarball)).value,
publishSigned := (publishSigned dependsOn(Universal / packageBin, Universal / packageZipTarball)).value,
))
.settings(addArtifact(Universal / packageZip / artifact, Universal / packageZip))
.settings(addArtifact(Universal / packageTgz / artifact, Universal / packageTgz))
.enablePlugins(JavaAppPackaging, UniversalDeployPlugin)
.dependsOn(root)