From 00de9d8f03b94a0c234860941fcffe6bed9c3fae Mon Sep 17 00:00:00 2001 From: Dmytro Orlov Date: Wed, 18 Oct 2023 12:49:00 +0200 Subject: [PATCH 1/2] support scala 3 type-level wildcards from _ to ? --- .../scala/format/specific/converters/ScalaConverter.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/avrohugger-core/src/main/scala/format/specific/converters/ScalaConverter.scala b/avrohugger-core/src/main/scala/format/specific/converters/ScalaConverter.scala index e0087f84..2393193b 100644 --- a/avrohugger-core/src/main/scala/format/specific/converters/ScalaConverter.scala +++ b/avrohugger-core/src/main/scala/format/specific/converters/ScalaConverter.scala @@ -76,7 +76,7 @@ object ScalaConverter { case Schema.Type.ARRAY => { val elementSchema = schema.getElementType val elementType = typeMatcher.toScalaType(classStore, namespace, elementSchema) - val JavaList = RootClass.newClass("java.util.List[_]") + val JavaList = javaListConvertor(targetScalaPartialVersion) val applyParam = REF("array") DOT("iterator") val elementConversion = convertFromJava( classStore, @@ -314,4 +314,9 @@ object ScalaConverter { } } + def javaListConvertor(targetScalaPartialVersion: String) = + if (targetScalaPartialVersion.startsWith("3.")) + RootClass.newClass("java.util.List[?]") + else + RootClass.newClass("java.util.List[_]") } From 35590bfc25ca5d2313d1171b57d47bca339531f4 Mon Sep 17 00:00:00 2001 From: Julian Peeters Date: Fri, 20 Oct 2023 13:51:01 -0700 Subject: [PATCH 2/2] Release version 1.7.0 --- README.md | 14 +++++++------- build.sbt | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7c8f46fc..1863de5f 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ _Note:_ Currently [Treehugger](http://eed3si9n.com/treehugger/comments.html#Scal ##### Get the dependency with: - "com.julianpeeters" %% "avrohugger-core" % "1.6.0" + "com.julianpeeters" %% "avrohugger-core" % "1.7.0" ##### Description: @@ -214,7 +214,7 @@ namespace rewritten. Multiple conflicting wildcards are not permitted. ##### Get the dependency with: - "com.julianpeeters" %% "avrohugger-filesorter" % "1.6.0" + "com.julianpeeters" %% "avrohugger-filesorter" % "1.7.0" ##### Description: @@ -234,22 +234,22 @@ To ensure dependent schemas are compiled in the proper order (thus avoiding `org #### `avrohugger-tools` - Download the avrohugger-tools jar for Scala [2.12](https://search.maven.org/remotecontent?filepath=com/julianpeeters/avrohugger-tools_2.12/1.6.0/avrohugger-tools_2.12-1.6.0-assembly.jar), or Scala [2.13](https://search.maven.org/remotecontent?filepath=com/julianpeeters/avrohugger-tools_2.13/1.6.0/avrohugger-tools_2.13-1.6.0-assembly.jar) (>30MB!) and use it like the avro-tools jar `Usage: [-string] (schema|protocol|datafile) input... outputdir`: + Download the avrohugger-tools jar for Scala [2.12](https://search.maven.org/remotecontent?filepath=com/julianpeeters/avrohugger-tools_2.12/1.7.0/avrohugger-tools_2.12-1.7.0-assembly.jar), or Scala [2.13](https://search.maven.org/remotecontent?filepath=com/julianpeeters/avrohugger-tools_2.13/1.7.0/avrohugger-tools_2.13-1.7.0-assembly.jar) (>30MB!) and use it like the avro-tools jar `Usage: [-string] (schema|protocol|datafile) input... outputdir`: * `generate` generates Scala case class definitions: -`java -jar /path/to/avrohugger-tools_2.12-1.6.0-assembly.jar generate schema user.avsc . ` +`java -jar /path/to/avrohugger-tools_2.12-1.7.0-assembly.jar generate schema user.avsc . ` * `generate-specific` generates definitions that extend Avro's `SpecificRecordBase`: -`java -jar /path/to/avrohugger-tools_2.12-1.6.0-assembly.jar generate-specific schema user.avsc . ` +`java -jar /path/to/avrohugger-tools_2.12-1.7.0-assembly.jar generate-specific schema user.avsc . ` * `generate-scavro` (`@deprecated` since avrohugger v1.5.0) generates definitions that extend Scavro's `AvroSerializable`: -`java -jar /path/to/avrohugger-tools_2.12-1.6.0-assembly.jar generate-scavro schema user.avsc . ` +`java -jar /path/to/avrohugger-tools_2.12-1.7.0-assembly.jar generate-scavro schema user.avsc . ` ## Warnings @@ -285,7 +285,7 @@ Contributors: | | | | | |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| :--- | :--- | :--- | -| [Marius Soutier](https://github.com/mariussoutier)
[Brian London](https://github.com/BrianLondon)
[alancnet](https://github.com/alancnet)
[Matt Coffin](https://github.com/mcoffin)
[Ryan Koval](http://github.ryankoval.com)
[Simonas Gelazevicius](https://github.com/simsasg)
[Paul Snively](https://github.com/PaulAtBanno)
[Marco Stefani](https://github.com/inafets)
[Andrew Gustafson](https://github.com/agustafson)
[Kostya Golikov](https://github.com/lazyval)
[Plínio Pantaleão](https://github.com/plinioj)
[Sietse de Kaper](https://github.com/targeter)
[Martin Mauch](https://github.com/nightscape)
[Leon Poon](https://github.com/LeonPoon) | [Paul Pearcy](https://github.com/ppearcy)
[Matt Allen](https://github.com/Matt343)
[C-zito](https://github.com/C-Zito)
[Tim Chan](https://github.com/timchan-lumoslabs)
[Saket](https://github.com/skate056)
[Daniel Davis](https://github.com/wabu)
[Zach Cox](https://github.com/zcox)
[Diego E. Alonso Blas](https://github.com/diesalbla)
[Fede Fernández](https://github.com/fedefernandez)
[Rob Landers](https://github.com/withinboredom)
[Simon Petty](https://github.com/simonpetty)
[Andreas Drobisch](https://github.com/adrobisch)
[Timo Schmid](https://github.com/timo-schmid) | [Stefano Galarraga](https://github.com/galarragas)
[Lars Albertsson](https://github.com/lallea)
[Eugene Platonov](https://github.com/jozic)
[Jerome Wacongne](https://github.com/ch4mpy)
[Jon Morra](https://github.com/jon-morra-zefr)
[Raúl Raja Martínez](https://github.com/raulraja)
[Kaur Matas](https://github.com/kmatasflp)
[Chris Albright](https://github.com/chrisalbright)
[Francisco Díaz](https://github.com/franciscodr)
[Bobby Rauchenberg](https://github.com/bobbyrauchenberg)
[Leonard Ehrenfried](https://github.com/leonardehrenfried)
[François Sarradin](https://github.com/fsarradin)
[niqdev](https://github.com/niqdev) | [Julien BENOIT](https://github.com/jbenoit2011)
[Adam Drakeford](https://github.com/dr4ke616)
[Carlos Silva](https://github.com/alchimystic)
[ismail Benammar](https://github.com/ismailBenammar)
[mcenkar](https://github.com/mcenkar)
[Luca Tronchin](https://github.com/ltronky)
[LydiaSkuse](https://github.com/LydiaSkuse)
[Algimantas Milašius](https://github.com/AlgMi)
[Leonard Ehrenfried](https://github.com/leonardehrenfried)
[Massimo Siani](https://github.com/massimosiani)
[Konstantin](https://github.com/tyger)
[natefitzgerald](https://github.com/natefitzgerald)
[Victor](https://github.com/gafiatulin) | +| [Marius Soutier](https://github.com/mariussoutier)
[Brian London](https://github.com/BrianLondon)
[alancnet](https://github.com/alancnet)
[Matt Coffin](https://github.com/mcoffin)
[Ryan Koval](http://github.ryankoval.com)
[Simonas Gelazevicius](https://github.com/simsasg)
[Paul Snively](https://github.com/PaulAtBanno)
[Marco Stefani](https://github.com/inafets)
[Andrew Gustafson](https://github.com/agustafson)
[Kostya Golikov](https://github.com/lazyval)
[Plínio Pantaleão](https://github.com/plinioj)
[Sietse de Kaper](https://github.com/targeter)
[Martin Mauch](https://github.com/nightscape)
[Leon Poon](https://github.com/LeonPoon) | [Paul Pearcy](https://github.com/ppearcy)
[Matt Allen](https://github.com/Matt343)
[C-zito](https://github.com/C-Zito)
[Tim Chan](https://github.com/timchan-lumoslabs)
[Saket](https://github.com/skate056)
[Daniel Davis](https://github.com/wabu)
[Zach Cox](https://github.com/zcox)
[Diego E. Alonso Blas](https://github.com/diesalbla)
[Fede Fernández](https://github.com/fedefernandez)
[Rob Landers](https://github.com/withinboredom)
[Simon Petty](https://github.com/simonpetty)
[Andreas Drobisch](https://github.com/adrobisch)
[Timo Schmid](https://github.com/timo-schmid)
[Dmytro Orlov](https://github.com/DmytroOrlov) | [Stefano Galarraga](https://github.com/galarragas)
[Lars Albertsson](https://github.com/lallea)
[Eugene Platonov](https://github.com/jozic)
[Jerome Wacongne](https://github.com/ch4mpy)
[Jon Morra](https://github.com/jon-morra-zefr)
[Raúl Raja Martínez](https://github.com/raulraja)
[Kaur Matas](https://github.com/kmatasflp)
[Chris Albright](https://github.com/chrisalbright)
[Francisco Díaz](https://github.com/franciscodr)
[Bobby Rauchenberg](https://github.com/bobbyrauchenberg)
[Leonard Ehrenfried](https://github.com/leonardehrenfried)
[François Sarradin](https://github.com/fsarradin)
[niqdev](https://github.com/niqdev) | [Julien BENOIT](https://github.com/jbenoit2011)
[Adam Drakeford](https://github.com/dr4ke616)
[Carlos Silva](https://github.com/alchimystic)
[ismail Benammar](https://github.com/ismailBenammar)
[mcenkar](https://github.com/mcenkar)
[Luca Tronchin](https://github.com/ltronky)
[LydiaSkuse](https://github.com/LydiaSkuse)
[Algimantas Milašius](https://github.com/AlgMi)
[Leonard Ehrenfried](https://github.com/leonardehrenfried)
[Massimo Siani](https://github.com/massimosiani)
[Konstantin](https://github.com/tyger)
[natefitzgerald](https://github.com/natefitzgerald)
[Victor](https://github.com/gafiatulin) | ##### Criticism is appreciated. diff --git a/build.sbt b/build.sbt index 743c40a6..ca2b6aef 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val avroVersion = "1.11.3" lazy val commonSettings = Seq( organization := "com.julianpeeters", - version := "1.6.0", + version := "1.7.0", ThisBuild / versionScheme := Some("semver-spec"), scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature"), Test / scalacOptions ++= Seq("-Yrangepos"),