-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sbt
187 lines (155 loc) · 5.18 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
import Dependencies._
import sbt.Resolver
val basicSettings = Seq(
organization:="io.zink",
version := "1.0.0",
scalaVersion := "2.12.3",
javacOptions ++= Seq("-Xdoclint:none","-g:none"),
//javacOptions += "-g:none",
scalacOptions in Test ++= Seq(
"-encoding",
"UTF-8"
),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
compileOrder := CompileOrder.Mixed,
compileOrder in Test:= CompileOrder.Mixed,
// Creates a jar with all libraries necessary
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case x => MergeStrategy.first
},
libraryDependencies ++= libraries ++ testLibraries,
homepage := Some( url("https://github.com/ZinkDigital/boson")),
description := "Boson - Streaming for JSON and BSON",
licenses += "The Apache License, Version 2.0" ->
url("http://www.apache.org/licenses/LICENSE-2.0.txt"),
pomIncludeRepository := { _ => false },
publishArtifact in Test := false,
// The developers of the project
developers := List(
Developer(
id="Zink Digital",
name= "zink",
email="[email protected]",
url=url("http://www.zink.io")
)
// then Growin' in here
),
// Information about the source code repository of your code
scmInfo := Some(
ScmInfo(
url("https://github.com/ZinkDigital/boson"),
"scm:[email protected]:ZinkDigital/boson.git"
)
),
//useGpg := true,
//pgpReadOnly := true,
credentials += Credentials(Path.userHome /".sbt" /".credentials"),
//pgpPassphrase := Some("boson0000".toArray),
pgpSecretRing := file("/home/margarida/.gnupg/secring.gpg"),
publishMavenStyle := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
val v = version.value
if (v.trim.endsWith("SNAPSHOT"))
//Opts.resolver.sonatypeSnapshots
Some("snapshots" at nexus + "content/repositories/snapshots")
else
//Opts.resolver.sonatypeStaging
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
)
val noPublishing = Seq(
publishArtifact := false,
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo"))))
def javaDoc = Seq(
doc in Compile := {
val cp = (fullClasspath in Compile in doc).value
val docTarget = (target in Compile in doc).value
val compileSrc = (javaSource in Compile).value
val s = streams.value
//def replace(x: Any) = x.toString.replace("boson-java", "boson-core")
def docLink = name.value match {
case "boson-java" => ""
case _ => ""
}
val cmd = "javadoc" +
" -sourcepath " + compileSrc +
" -classpath " + cp.map(_.data).mkString(":") +
" -d " + docTarget +
docLink +
" -encoding utf8" +
" -public" +
" -windowtitle " + name.value + "_" + version.value +
" -subpackages" +
" io.zink"
s.log.info(cmd)
sys.process.Process(cmd)
docTarget
}
)
val libraries = Seq(
"org.glassfish" % "javax.json" % "1.1",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4",
"io.netty" % "netty-all" % "4.1.22.Final",
"org.scala-lang.modules" % "scala-java8-compat_2.12" % "0.8.0",
"com.chuusai" % "shapeless_2.12" % "2.3.3",
"org.parboiled" %% "parboiled" % "2.1.4",
"net.jodah" % "typetools" % "0.5.0",
asm, asmTree, asmAnalysis, asmUtil
)
val testLibraries = Seq(
"org.scalatest" %% "scalatest" % "3.0.5" % Test withSources(),
"de.undercouch" % "bson4jackson" % "2.7.0",
"junit" % "junit" % "4.12" % Test,
"io.vertx" % "vertx-core" % "3.5.0",
"com.novocode" % "junit-interface" % "0.11" % "test",
"com.jayway.jsonpath" % "json-path" % "2.4.0",
"com.google.code.gson" % "gson" % "2.3.1",
"org.slf4j" % "slf4j-simple" % "1.7.25",
"io.rest-assured" % "scala-support" % "3.0.6",
"io.rest-assured" % "rest-assured" % "3.0.6",
"com.squareup.okhttp3" % "mockwebserver" % "3.9.1",
"de.undercouch" % "bson4jackson" % "2.7.0"
)
lazy val root = project.in(file("."))
.aggregate(bosonCore, bosonScala, bosonJava)
.settings(basicSettings: _*)
.settings(noPublishing: _*)
lazy val bosonCore = project.in(file("boson-core"))
.settings(basicSettings: _*)
.settings(javaDoc: _*)
.settings(
javacOptions in Test += "-g", // needed for bytecode rewriting
crossPaths := false,
autoScalaLibrary := false
)
lazy val bosonScala = project.in(file("boson-scala"))
.dependsOn(bosonCore)
.settings(basicSettings: _*)
.settings(javaDoc: _*)
.settings(
javacOptions in Test += "-g", // needed for bytecode rewriting
crossPaths := false,
autoScalaLibrary := false
)
lazy val bosonJava = project.in(file("boson-java"))
.dependsOn(bosonCore)
.settings(basicSettings: _*)
.settings(javaDoc: _*)
.settings(
javacOptions in Test += "-g", // needed for bytecode rewriting
crossPaths := false,
autoScalaLibrary := false
)
lazy val bosonPerformance = project.in(file("boson-performance"))
.dependsOn(bosonScala)
//.dependsOn(bosonJava)
.settings(basicSettings: _*)
.settings(javaDoc: _*)
.settings(
libraryDependencies ++= Dependencies.compile( perform),
javacOptions in Test += "-g", // needed for bytecode rewriting
crossPaths := false,
autoScalaLibrary := false
)