This repository has been archived by the owner on Mar 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sbt
90 lines (69 loc) · 2.93 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
name := "bblfsh-client"
organization := "org.bblfsh"
git.useGitDescribe := true
enablePlugins(GitVersioning)
scalaVersion := "2.11.11"
val protoDir = "src/main/proto"
target in assembly := file("build")
// Where the .h files will be generated by javah from the sbt-jni plugin
target in javah := file("src/main/native")
libraryDependencies ++= Seq(
"org.rogach" %% "scallop" % "3.0.3",
"commons-io" % "commons-io" % "2.5",
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion,
"io.grpc" % "grpc-netty" % scalapb.compiler.Version.grpcJavaVersion,
"org.scalatest" %% "scalatest" % "3.0.1" % "test"
)
// Exclude resources/libuast folder in .jar generated with sbt assembly
excludeFilter in unmanagedResources := "libuast"
assemblyMergeStrategy in assembly := {
case "META-INF/io.netty.versions.properties" | "META-INF\\io.netty.versions.properties" =>
MergeStrategy.last
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
test in assembly := {}
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
)
PB.protoSources in Compile := Seq(file(protoDir))
sonatypeProfileName := "org.bblfsh"
// pom settings for sonatype
homepage := Some(url("https://github.com/bblfsh/scala-client"))
scmInfo := Some(ScmInfo(url("https://github.com/bblfsh/scala-client"),
"[email protected]:bblfsh/scala-client.git"))
developers += Developer("bzz",
"Alexander Bezzubov",
url("https://github.com/bzz"))
developers += Developer("ncordon",
"Nacho Cordón",
url("https://github.com/ncordon"))
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
pomIncludeRepository := (_ => false)
crossPaths := false
publishMavenStyle := true
exportJars := true
val SONATYPE_USERNAME = scala.util.Properties.envOrElse("SONATYPE_USERNAME", "NOT_SET")
val SONATYPE_PASSWORD = scala.util.Properties.envOrElse("SONATYPE_PASSWORD", "NOT_SET")
val SONATYPE_PASSPHRASE = scala.util.Properties.envOrElse("SONATYPE_PASSPHRASE", "NOT_SET")
credentials += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
SONATYPE_USERNAME,
SONATYPE_PASSWORD)
useGpg := false
pgpSecretRing := baseDirectory.value / "project" / ".gnupg" / "secring.gpg"
pgpPublicRing := baseDirectory.value / "project" / ".gnupg" / "pubring.gpg"
pgpPassphrase := Some(SONATYPE_PASSPHRASE.toArray)
isSnapshot := version.value endsWith "SNAPSHOT"
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}