11import sbt ._
22
33lazy 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"
56
6- lazy val supportedScalaVersions = List (scala212, scala213)
7+ lazy val supportedScalaVersions = List (scala212, scala213, scala3 )
78
89val 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
1415)
1516
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 )
2017
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+ })
2327 .settings(commonSettings)
24- .dependsOn(`scala-protobuf-java-macro`)
2528 .enablePlugins(ProtobufTestPlugin )
2629
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`)
2934 .settings(publishArtifact := false )
3035
31- scalafmtOnCompile in ThisBuild := true
32-
33- // publish
36+ ThisBuild / scalafmtOnCompile := true
3437
35- releasePublishArtifactsAction in ThisBuild := releaseStepCommandAndRemaining(" +publishSigned" )
38+ ThisBuild / releasePublishArtifactsAction := releaseStepCommandAndRemaining(" +publishSigned" )
3639
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" )
4346}
4447
45- publishMavenStyle in ThisBuild := true
48+ ThisBuild / publishMavenStyle := true
4649
47- credentials in ThisBuild += Credentials (Path .userHome / " .ivy2" / " .credentials_sonatype" )
50+ ThisBuild / credentials += Credentials (Path .userHome / " .ivy2" / " .credentials_sonatype" )
4851
49- publishArtifact in Test := false
52+ Test / publishArtifact := false
5053
51- pomIncludeRepository in ThisBuild := { _ => false }
54+ ThisBuild / pomIncludeRepository := { _ => false }
5255
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" ))
5457
55- pomExtra in ThisBuild := {
56- <licenses >
58+ ThisBuild / pomExtra := {
59+ <licenses >
5760 <license >
5861 <name >The Apache Software License , Version 2.0 </name >
5962 <url >http:// www.apache.org/ licenses/ LICENSE - 2.0 .txt</url >
@@ -74,5 +77,5 @@ pomExtra in ThisBuild := {
7477 </developers >
7578}
7679
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