From b31dc53b08f1f5d45dc1d4280e89b52dfb750c68 Mon Sep 17 00:00:00 2001 From: lloydmeta Date: Sun, 12 Nov 2023 14:26:57 +0900 Subject: [PATCH 1/3] * 1.8.0-SNAPSHOT * Fixup readme * Fixup Scala 3 macro + scalafmt Signed-off-by: lloydmeta --- README.md | 6 +++--- build.sbt | 6 ++---- .../scala-3/enumeratum/values/ValueEnumCompat.scala | 10 ++++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 57bd9cfd..691a28a6 100644 --- a/README.md +++ b/README.md @@ -343,7 +343,7 @@ libraryDependencies ++= Seq( As expected, usage is exactly the same as normal Scala. ## Play Integration -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play_2.12) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play_2.13) The `enumeratum-play` project is published separately and gives you access to various tools to help you avoid boilerplate in your Play project. @@ -358,7 +358,7 @@ libraryDependencies ++= Seq( ``` #### Dependencies and compatibility notes -- As of version 1.6.1, `enumeratum-play` for Scala 2.12 requires Play >= 2.8 +- As of version 1.8, `enumeratum-play` requires Scala 2.13+ and Play >= 3 ### Usage @@ -486,7 +486,7 @@ object GreetingForm { ``` ## Play JSON -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play-json_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play-json_2.12) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play-json_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.beachape/enumeratum-play-json_2.13) The `enumeratum-play-json` project is published separately and gives you access to Play's auto-generated boilerplate for JSON serialization in your Enum's. diff --git a/build.sbt b/build.sbt index 98cafe13..fbee4fce 100644 --- a/build.sbt +++ b/build.sbt @@ -270,7 +270,7 @@ lazy val enumeratumPlayJson = crossProject(JSPlatform, JVMPlatform) .jsSettings(jsTestSettings) .settings( name := "enumeratum-play-json", - version := Versions.Core.head, + version := "1.8.0-SNAPSHOT", crossScalaVersions := scalaVersionsAll, libraryDependencies ++= Seq( "org.playframework" %%% "play-json" % "3.0.0", @@ -299,7 +299,7 @@ lazy val enumeratumPlay = Project(id = "enumeratum-play", base = file("enumeratu .settings(commonWithPublishSettings) .settings(testSettings) .settings( - version := Versions.Core.head, + version := "1.8.0-SNAPSHOT", // Play do not support 2.12 (default from common settings) scalaVersion := scala_2_13Version, crossScalaVersions := Seq(scala_2_13Version, scala_3Version), @@ -766,10 +766,8 @@ lazy val publishSettings = Seq( else Some("releases" at nexus + "service/local/staging/deploy/maven2") }, - pgpPassphrase := sys.env.get("PGP_PASSPHRASE").map(_.toCharArray), publishMavenStyle := true, Test / publishArtifact := false, - PgpKeys.pgpPassphrase := sys.env.get("PGP_PASSPHRASE").map(_.toCharArray), pomIncludeRepository := { _ => false } diff --git a/enumeratum-core/src/main/scala-3/enumeratum/values/ValueEnumCompat.scala b/enumeratum-core/src/main/scala-3/enumeratum/values/ValueEnumCompat.scala index f5da15a2..0dc258d4 100644 --- a/enumeratum-core/src/main/scala-3/enumeratum/values/ValueEnumCompat.scala +++ b/enumeratum-core/src/main/scala-3/enumeratum/values/ValueEnumCompat.scala @@ -14,6 +14,7 @@ private[enumeratum] trait IntEnumCompanion { private[enumeratum] trait IntEnumCompat[A <: IntEnumEntry] { _enum: IntEnum[A] => + // format: off /** Returns a Seq of [[A]] objects that the macro was able to find. * * You will want to use this in some way to implement your [[values]] method. In fact, if you @@ -21,6 +22,7 @@ private[enumeratum] trait IntEnumCompat[A <: IntEnumEntry] { _enum: IntEnum[A] = */ protected inline def findValues: IndexedSeq[A] = ${ ValueEnumMacros.findIntValueEntriesImpl[A] } + // format: on } private[enumeratum] trait LongEnumCompanion { @@ -34,12 +36,14 @@ private[enumeratum] trait LongEnumCompanion { private[enumeratum] trait LongEnumCompat[A <: LongEnumEntry] { _enum: LongEnum[A] => + // format: off /** Returns a Seq of [[A]] objects that the macro was able to find. * * You will want to use this in some way to implement your [[values]] method. In fact, if you * aren't using this method...why are you even bothering with this lib? */ protected inline def findValues: IndexedSeq[A] = ${ ValueEnumMacros.findLongValueEntriesImpl[A] } + // format: on } private[enumeratum] trait ShortEnumCompanion { @@ -76,6 +80,7 @@ private[enumeratum] trait StringEnumCompanion { private[enumeratum] trait StringEnumCompat[A <: StringEnumEntry] { _enum: StringEnum[A] => + // format: off /** Returns a Seq of [[A]] objects that the macro was able to find. * * You will want to use this in some way to implement your [[values]] method. In fact, if you @@ -84,6 +89,7 @@ private[enumeratum] trait StringEnumCompat[A <: StringEnumEntry] { _enum: String protected inline def findValues: IndexedSeq[A] = ${ ValueEnumMacros.findStringValueEntriesImpl[A] } + // format: on } private[enumeratum] trait ByteEnumCompanion { @@ -97,6 +103,7 @@ private[enumeratum] trait ByteEnumCompanion { private[enumeratum] trait ByteEnumCompat[A <: ByteEnumEntry] { _enum: ByteEnum[A] => + // format: off /** Returns a Seq of [[A]] objects that the macro was able to find. * * You will want to use this in some way to implement your [[values]] method. In fact, if you @@ -105,6 +112,7 @@ private[enumeratum] trait ByteEnumCompat[A <: ByteEnumEntry] { _enum: ByteEnum[A protected inline def findValues: IndexedSeq[A] = ${ ValueEnumMacros.findByteValueEntriesImpl[A] } + // format: on } private[enumeratum] trait CharEnumCompanion { @@ -118,6 +126,7 @@ private[enumeratum] trait CharEnumCompanion { private[enumeratum] trait CharEnumCompat[A <: CharEnumEntry] { _enum: CharEnum[A] => + // format: off /** Returns a Seq of [[A]] objects that the macro was able to find. * * You will want to use this in some way to implement your [[values]] method. In fact, if you @@ -126,4 +135,5 @@ private[enumeratum] trait CharEnumCompat[A <: CharEnumEntry] { _enum: CharEnum[A protected inline def findValues: IndexedSeq[A] = ${ ValueEnumMacros.findCharValueEntriesImpl[A] } + // format: on } From 34e95795bb9f4b928c650164634bf47caead3e64 Mon Sep 17 00:00:00 2001 From: lloydmeta Date: Sun, 12 Nov 2023 14:32:11 +0900 Subject: [PATCH 2/3] 1.8.0 release Signed-off-by: lloydmeta --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index fbee4fce..b1d54482 100644 --- a/build.sbt +++ b/build.sbt @@ -270,7 +270,7 @@ lazy val enumeratumPlayJson = crossProject(JSPlatform, JVMPlatform) .jsSettings(jsTestSettings) .settings( name := "enumeratum-play-json", - version := "1.8.0-SNAPSHOT", + version := "1.8.0", crossScalaVersions := scalaVersionsAll, libraryDependencies ++= Seq( "org.playframework" %%% "play-json" % "3.0.0", @@ -299,7 +299,7 @@ lazy val enumeratumPlay = Project(id = "enumeratum-play", base = file("enumeratu .settings(commonWithPublishSettings) .settings(testSettings) .settings( - version := "1.8.0-SNAPSHOT", + version := "1.8.0", // Play do not support 2.12 (default from common settings) scalaVersion := scala_2_13Version, crossScalaVersions := Seq(scala_2_13Version, scala_3Version), From 79a4d31960a9389218374e3db0a9915a77e4a294 Mon Sep 17 00:00:00 2001 From: lloydmeta Date: Sun, 12 Nov 2023 14:32:40 +0900 Subject: [PATCH 3/3] 1.8.1-SNAPSHOT begins for play integrations Signed-off-by: lloydmeta --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index b1d54482..259b7e6a 100644 --- a/build.sbt +++ b/build.sbt @@ -270,7 +270,7 @@ lazy val enumeratumPlayJson = crossProject(JSPlatform, JVMPlatform) .jsSettings(jsTestSettings) .settings( name := "enumeratum-play-json", - version := "1.8.0", + version := "1.8.1-SNAPSHOT", crossScalaVersions := scalaVersionsAll, libraryDependencies ++= Seq( "org.playframework" %%% "play-json" % "3.0.0", @@ -299,7 +299,7 @@ lazy val enumeratumPlay = Project(id = "enumeratum-play", base = file("enumeratu .settings(commonWithPublishSettings) .settings(testSettings) .settings( - version := "1.8.0", + version := "1.8.1-SNAPSHOT", // Play do not support 2.12 (default from common settings) scalaVersion := scala_2_13Version, crossScalaVersions := Seq(scala_2_13Version, scala_3Version),