-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
81 lines (65 loc) · 2.59 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
import sbt._
lazy val scala213 = "2.13.6"
lazy val scala212 = "2.12.14"
lazy val scala3 = "3.1.0"
lazy val supportedScalaVersions = List(scala212, scala213, scala3)
val commonSettings = Seq(
scalaVersion := scala3,
scalacOptions += "-language:experimental.macros",
organization := "com.github.changvvb",
crossScalaVersions := supportedScalaVersions,
releasePublishArtifactsAction := PgpKeys.publishSigned.value
)
lazy val `scala-protobuf-java` = project
.in(file("pbconverts"))
.settings(libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.9" % "test")
.settings(libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
case _ => Nil
}
})
.settings(commonSettings)
.enablePlugins(ProtobufTestPlugin)
lazy val root = project
.in(file("."))
.withId("root")
.aggregate(`scala-protobuf-java`)
.settings(publishArtifact := false)
ThisBuild / scalafmtOnCompile := true
ThisBuild / releasePublishArtifactsAction := releaseStepCommandAndRemaining("+publishSigned")
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
ThisBuild / publishMavenStyle := true
ThisBuild / credentials += Credentials(Path.userHome / ".ivy2" / ".credentials_sonatype")
Test / publishArtifact := false
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / homepage := Some(url("https://github.com/changvvb/scala-protobuf-java"))
ThisBuild / pomExtra := {
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:changvvb/scala-protobuf-java.git</connection>
<developerConnection>scm:git:git@github.com:changvvb/scala-protobuf-java.git</developerConnection>
<url>https://github.com/changvvb/scala-protobuf-java</url>
</scm>
<developers>
<developer>
<id>changvvb</id>
<name>Weiwei Chang</name>
<email>changvvb@gmail.com</email>
</developer>
</developers>
}
ThisBuild / publishConfiguration := publishConfiguration.value.withOverwrite(true)
ThisBuild / publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)