This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sbt
131 lines (113 loc) · 4.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import Dependencies._
import sbt.Keys._
import sbt._
scalacOptions in ThisBuild ++= Seq("-feature", "-deprecation", "-language:postfixOps", "-language:higherKinds", "-language:implicitConversions")
ThisBuild / organization := "cc.akkaha"
ThisBuild / version := "0.8.0"
ThisBuild / scalaVersion := "2.13.3"
ThisBuild / maintainer := "[email protected]"
lazy val root = Project("asura", file("."))
.dependsOn(app, cli)
.aggregate(app, cli)
// Sub Projects
def asuraProjects(id: String) = Project(id, file(id))
.settings(publishSettings: _*)
lazy val app = asuraProjects("asura-app")
.enablePlugins(PlayScala)
.settings(libraryDependencies ++= appDependencies)
.settings(releaseSettings: _*)
.settings(publishArtifact in Compile := true)
.dependsOn(
play % "compile->compile;test->test",
common % "compile->compile;test->test",
cluster % "compile->compile;test->test",
core % "compile->compile;test->test",
namerd % "compile->compile;test->test",
example % "compile->compile;test->test",
dubbo % "compile->compile;test->test",
kafka % "compile->compile;test->test",
ui % "compile->compile;test->test",
).aggregate(play, common, cluster, core, namerd, dubbo, kafka, example)
lazy val example = asuraProjects("asura-example")
.settings(libraryDependencies ++= Seq(guice))
.dependsOn(core)
lazy val play = asuraProjects("asura-play")
.settings(libraryDependencies ++= appPlayDeps)
.dependsOn(common % "compile->compile;test->test")
lazy val common = asuraProjects("asura-common")
.settings(libraryDependencies ++= commonDependencies)
lazy val cluster = asuraProjects("asura-cluster")
.settings(libraryDependencies ++= clusterDependencies)
.dependsOn(common % "compile->compile;test->test")
lazy val ui = asuraProjects("asura-ui")
.settings(libraryDependencies ++= uiDependencies)
.dependsOn(common % "compile->compile;test->test")
lazy val cli = asuraProjects("asura-ui-cli")
.settings(libraryDependencies ++= uiCliDependencies)
.dependsOn(ui % "compile->compile;test->test")
lazy val core = asuraProjects("asura-core")
.settings(libraryDependencies ++= coreDependencies)
.dependsOn(
common % "compile->compile;test->test",
dubbo % "compile->compile;test->test",
kafka % "compile->compile;test->test",
ui % "compile->compile;test->test",
)
lazy val namerd = asuraProjects("asura-namerd")
.settings(libraryDependencies ++= namerdDependencies)
.dependsOn(common % "compile->compile;test->test")
lazy val dubbo = asuraProjects("asura-dubbo")
.settings(libraryDependencies ++= dubboDependencies)
.dependsOn(common % "compile->compile;test->test")
lazy val kafka = asuraProjects("asura-kafka")
.settings(libraryDependencies ++= kafkaDependencies)
.dependsOn(common % "compile->compile;test->test")
// release
val username = "asura-pro"
val repo = "asura"
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
lazy val releaseSettings = Seq(
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
//runClean,
// runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommand("publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
//pushChanges
)
)
lazy val publishSettings = Seq(
homepage := Some(url(s"https://github.com/$username/$repo")),
licenses += "MIT" -> url(s"https://github.com/$username/$repo/blob/master/LICENSE"),
scmInfo := Some(ScmInfo(url(s"https://github.com/$username/$repo"), s"[email protected]:$username/$repo.git")),
apiURL := Some(url(s"https://$username.github.io/$repo/latest/api/")),
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
developers := List(
Developer(
id = username,
name = "zhengshaodong",
email = "[email protected]",
url = new URL(s"http://github.com/${username}")
)
),
useGpg := true,
usePgpKeyHex("200BB242B4BE47DD"),
publishMavenStyle := true,
publishArtifact in Test := false,
publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeSnapshots else Opts.resolver.sonatypeStaging),
credentials ++= (for {
username <- sys.env.get("SONATYPE_USERNAME")
password <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq,
// Following 2 lines need to get around https://github.com/sbt/sbt/issues/4275
publishConfiguration := publishConfiguration.value.withOverwrite(true),
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)
)
coverageEnabled := false