Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

sbt-airframe: Support reading HTTP interfaces defined in Scala 2.13 #970

Closed
xerial opened this issue Mar 11, 2020 · 2 comments
Closed

sbt-airframe: Support reading HTTP interfaces defined in Scala 2.13 #970

xerial opened this issue Mar 11, 2020 · 2 comments
Milestone

Comments

@xerial
Copy link
Member

xerial commented Mar 11, 2020

  • sbt plugin needs to be built for Scala 2.12
  • If we use this plugin to read HTTP interfaces built in Scala 2.13, an error occurs when reading Scala Signature using Surface:

Scala signature ClusterApi has wrong version expected: 5.0 found: 5.2

  • Idea: sbt-airframe plugin needs to switch the Airframe version to use based on scalaVersion setting in the project.
java.lang.RuntimeException: error reading Scala signature of com.treasuredata.prestobase.model.api.v1.ClusterApi: Scala signature ClusterApi has wrong version
 expected: 5.0
 found: 5.2 in com.treasuredata.prestobase.model.api.v1.ClusterApi
	at scala.reflect.internal.pickling.UnPickler.unpickle(UnPickler.scala:51)
	at scala.reflect.runtime.JavaMirrors$JavaMirror.unpickleClass(JavaMirrors.scala:653)
	at scala.reflect.runtime.SymbolLoaders$TopClassCompleter.$anonfun$complete$2(SymbolLoaders.scala:37)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.reflect.internal.SymbolTable.slowButSafeEnteringPhaseNotLaterThan(SymbolTable.scala:332)
	at scala.reflect.runtime.SymbolLoaders$TopClassCompleter.complete(SymbolLoaders.scala:34)
	at scala.reflect.runtime.SymbolLoaders$TopClassCompleter.load(SymbolLoaders.scala:42)
	at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.completeTypeParams$1(SynchronizedSymbols.scala:173)
	at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.$anonfun$typeParams$1(SynchronizedSymbols.scala:180)
	at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.typeParams(SynchronizedSymbols.scala:149)
	at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.typeParams$(SynchronizedSymbols.scala:165)
	at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol$$anon$7.typeParams(SynchronizedSymbols.scala:203)
	at scala.reflect.internal.Types$NoArgsTypeRef.typeParams(Types.scala:1892)
	at scala.reflect.internal.Types$NoArgsTypeRef.isHigherKinded(Types.scala:1891)
	at scala.reflect.internal.Types$Type.takesTypeArgs(Types.scala:281)
	at wvlet.airframe.surface.reflect.ReflectSurfaceFactory$SurfaceFinder$$anonfun$higherKindedTypeFactory$1.applyOrElse(ReflectSurfaceFactory.scala:354)```
@xerial
Copy link
Member Author

xerial commented Mar 11, 2020

An approach is:

  • Move the client code generator to airframe-http, and add a main method to invoke the generator
  • sbt-airframe picks an airframe-http library for the target Scala version, and fork a JVM to generate the code.

@xerial xerial mentioned this issue Mar 12, 2020
76 tasks
@xerial xerial added this to the Airframe 20 milestone Mar 17, 2020
xerial added a commit that referenced this issue Mar 18, 2020
…nt code (#998)

* Download airframe-http using Coursier
* Add CLI launcher
* Add defaultClassName
* Multiple Scala version support #970
* Refresh the client code if the service interface is changed
@xerial
Copy link
Member Author

xerial commented Mar 18, 2020

#998 should have fixed this issue.

@xerial xerial closed this as completed Mar 18, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant