1
1
import sbt ._
2
2
3
3
lazy val scala213 = " 2.13.6"
4
- lazy val scala212 = " 2.12.12"
4
+ lazy val scala212 = " 2.12.14"
5
+ lazy val scala3 = " 3.1.0"
5
6
6
- lazy val supportedScalaVersions = List (scala212, scala213)
7
+ lazy val supportedScalaVersions = List (scala212, scala213, scala3 )
7
8
8
9
val commonSettings = Seq (
9
- scalaVersion := scala213 ,
10
- scalacOptions += " -language:experimental.macros" ,
11
- organization := " com.github.changvvb" ,
12
- crossScalaVersions := supportedScalaVersions,
13
- releasePublishArtifactsAction := PgpKeys .publishSigned.value
10
+ scalaVersion := scala3 ,
11
+ scalacOptions += " -language:experimental.macros" ,
12
+ organization := " com.github.changvvb" ,
13
+ crossScalaVersions := supportedScalaVersions,
14
+ releasePublishArtifactsAction := PgpKeys .publishSigned.value
14
15
)
15
16
16
- lazy val `scala-protobuf-java-macro` = project.in(file(" pbconverts-macro" ))
17
- .settings(libraryDependencies ++= Seq (" org.scala-lang" % " scala-reflect" % scalaVersion.value))
18
- .settings(commonSettings)
19
- .enablePlugins(ProtobufPlugin )
20
17
21
- lazy val `scala-protobuf-java` = project.in(file(" pbconverts" ))
22
- .settings(libraryDependencies += " org.scalatest" %% " scalatest" % " 3.2.0" % " test" )
18
+ lazy val `scala-protobuf-java` = project
19
+ .in(file(" pbconverts" ))
20
+ .settings(libraryDependencies += " org.scalatest" %% " scalatest" % " 3.2.9" % " test" )
21
+ .settings(libraryDependencies ++= {
22
+ CrossVersion .partialVersion(scalaVersion.value) match {
23
+ case Some ((2 , _)) => Seq (" org.scala-lang" % " scala-reflect" % scalaVersion.value)
24
+ case _ => Nil
25
+ }
26
+ })
23
27
.settings(commonSettings)
24
- .dependsOn(`scala-protobuf-java-macro`)
25
28
.enablePlugins(ProtobufTestPlugin )
26
29
27
- lazy val root = project.in(file(" ." )).withId(" root" )
28
- .aggregate(`scala-protobuf-java`, `scala-protobuf-java-macro`)
30
+ lazy val root = project
31
+ .in(file(" ." ))
32
+ .withId(" root" )
33
+ .aggregate(`scala-protobuf-java`)
29
34
.settings(publishArtifact := false )
30
35
31
- scalafmtOnCompile in ThisBuild := true
32
-
33
- // publish
36
+ ThisBuild / scalafmtOnCompile := true
34
37
35
- releasePublishArtifactsAction in ThisBuild := releaseStepCommandAndRemaining(" +publishSigned" )
38
+ ThisBuild / releasePublishArtifactsAction := releaseStepCommandAndRemaining(" +publishSigned" )
36
39
37
- publishTo in ThisBuild := {
38
- val nexus = " https://oss.sonatype.org/"
39
- if (version.value.trim.endsWith(" SNAPSHOT" ))
40
- Some (" snapshots" at nexus + " content/repositories/snapshots" )
41
- else
42
- Some (" releases" at nexus + " service/local/staging/deploy/maven2" )
40
+ ThisBuild / publishTo := {
41
+ val nexus = " https://oss.sonatype.org/"
42
+ if (version.value.trim.endsWith(" SNAPSHOT" ))
43
+ Some (" snapshots" at nexus + " content/repositories/snapshots" )
44
+ else
45
+ Some (" releases" at nexus + " service/local/staging/deploy/maven2" )
43
46
}
44
47
45
- publishMavenStyle in ThisBuild := true
48
+ ThisBuild / publishMavenStyle := true
46
49
47
- credentials in ThisBuild += Credentials (Path .userHome / " .ivy2" / " .credentials_sonatype" )
50
+ ThisBuild / credentials += Credentials (Path .userHome / " .ivy2" / " .credentials_sonatype" )
48
51
49
- publishArtifact in Test := false
52
+ Test / publishArtifact := false
50
53
51
- pomIncludeRepository in ThisBuild := { _ => false }
54
+ ThisBuild / pomIncludeRepository := { _ => false }
52
55
53
- homepage in ThisBuild := Some (url(" https://github.com/changvvb/scala-protobuf-java" ))
56
+ ThisBuild / homepage := Some (url(" https://github.com/changvvb/scala-protobuf-java" ))
54
57
55
- pomExtra in ThisBuild := {
56
- <licenses >
58
+ ThisBuild / pomExtra := {
59
+ <licenses >
57
60
<license >
58
61
<name >The Apache Software License , Version 2.0 </name >
59
62
<url >http:// www.apache.org/ licenses/ LICENSE - 2.0 .txt</url >
@@ -74,5 +77,5 @@ pomExtra in ThisBuild := {
74
77
</developers >
75
78
}
76
79
77
- publishConfiguration in ThisBuild := publishConfiguration.value.withOverwrite(true )
78
- publishLocalConfiguration in ThisBuild := publishLocalConfiguration.value.withOverwrite(true )
80
+ ThisBuild / publishConfiguration := publishConfiguration.value.withOverwrite(true )
81
+ ThisBuild / publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true )
0 commit comments