Skip to content

Commit

Permalink
Review Scala 3 publishing settings for better compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jcazevedo committed Oct 31, 2021
1 parent cda1e59 commit 42b02cf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -9,12 +9,14 @@ jobs:
fail-fast: false
matrix:
jdk: [adopt@1.8]
scala: ['2.12', '2.13', '3.1']
scala: ['2.12', '2.13', '3.0', '3.1']
include:
- scala: '2.12'
scala-version: 2.12.15
- scala: '2.13'
scala-version: 2.13.6
- scala: '3.0'
scala-version: 3.0.2
- scala: '3.1'
scala-version: 3.1.0

Expand Down
8 changes: 6 additions & 2 deletions build.sbt
Expand Up @@ -110,7 +110,11 @@ lazy val commonSettings = Seq(

publishMavenStyle := true,
Test / publishArtifact := false,
publishTo := sonatypePublishToBundle.value
publishTo := sonatypePublishToBundle.value,

// Don't publish for Scala 3.1 or later, only for 3.0. This is following the recommendation in
// https://scala-lang.org/blog/2021/10/21/scala-3.1.0-released.html#compatibility-notice.
publish / skip := forScalaVersions { case (3, x) if x > 0 => true; case _ => false }.value
// format: on
)

Expand All @@ -119,7 +123,7 @@ lazy val commonSettings = Seq(
def crossVersionSharedSources(unmanagedSrcs: SettingKey[Seq[File]]) = {
unmanagedSrcs ++= {
val versionNumber = CrossVersion.partialVersion(scalaVersion.value)
val expectedVersions = Seq(scala212, scala213, scala3).flatMap(CrossVersion.partialVersion)
val expectedVersions = Seq(scala212, scala213, scala30, scala31).flatMap(CrossVersion.partialVersion)
expectedVersions.flatMap { case v @ (major, minor) =>
List(
if (versionNumber.exists(_ <= v)) unmanagedSrcs.value.map { dir => new File(dir.getPath + s"-$major.$minor-") }
Expand Down
2 changes: 1 addition & 1 deletion core/build.sbt
Expand Up @@ -2,6 +2,6 @@ import Dependencies.Version._

name := "pureconfig-core"

crossScalaVersions := Seq(scala212, scala213, scala3)
crossScalaVersions := Seq(scala212, scala213, scala30, scala31)

libraryDependencies += Dependencies.typesafeConfig
3 changes: 2 additions & 1 deletion project/Dependencies.scala
Expand Up @@ -5,7 +5,8 @@ object Dependencies {
object Version {
val scala212 = "2.12.15"
val scala213 = "2.13.6"
val scala3 = "3.1.0"
val scala30 = "3.0.2"
val scala31 = "3.1.0"

val typesafeConfig = "1.4.1"

Expand Down
2 changes: 1 addition & 1 deletion testkit/build.sbt
Expand Up @@ -2,7 +2,7 @@ import Dependencies.Version._

name := "pureconfig-testkit"

crossScalaVersions := Seq(scala212, scala213, scala3)
crossScalaVersions := Seq(scala212, scala213, scala30, scala31)

libraryDependencies ++= Seq(
Dependencies.scalaTest,
Expand Down
2 changes: 1 addition & 1 deletion tests/build.sbt
Expand Up @@ -2,6 +2,6 @@ import Dependencies.Version._

name := "pureconfig-tests"

crossScalaVersions := Seq(scala212, scala213, scala3)
crossScalaVersions := Seq(scala212, scala213, scala30, scala31)

publish / skip := true

0 comments on commit 42b02cf

Please sign in to comment.