eed3si9n / scalaxb

scalaxb is an XML data binding tool for Scala.
http://scalaxb.org/
MIT License
337 stars 154 forks source link

http4s client + tagless final style generation #596

Closed zarthross closed 1 year ago

zarthross commented 1 year ago

What this PR Does:

TODO

zarthross commented 1 year ago

@eed3si9n No rush, but do you have an idea on when you might merge and release this change? I'm trying to determine if I need to cut an internal release or not in order to use this feature and knowing what your expected timeline is could save me some time 😄

eed3si9n commented 1 year ago

I'll try to release today or tomorrow.

eed3si9n commented 1 year ago

So I released 1.10.0, but it doesn't seem to generate http4s client when I set to the following:

import Dependencies._

ThisBuild / organization  := "com.example"
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "2.13.10"

lazy val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.3.0"
lazy val scalaParser = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
lazy val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.0"

lazy val root = (project in file("."))
  .enablePlugins(ScalaxbPlugin)
  .settings(
    name := "soap",
    libraryDependencies ++= Seq(scalaXml, scalaParser, jaxbApi),
    Compile / scalaxb / scalaxbPackageName := "generated",
    Compile / scalaxb / scalaxbGenerateDispatchClient := false,
    Compile / scalaxb / scalaxbGenerateHttp4sClient := true,
  )
zarthross commented 1 year ago

Thanks for releasing it!!!

Looks like I missed an edge case, you need to explicitly set the scalaxbHttpClientStyle to tagless in order for it to work. If you like I can do a follow up PR to fix that.

scalaxbHttpClientStyle  := HttpClientStyle.Tagless,
eed3si9n commented 1 year ago

Here's how I followed up - https://github.com/eed3si9n/scalaxb/pull/597