Skip to content

Conversation

@ramzimaalej
Copy link
Contributor

@ramzimaalej ramzimaalej commented Nov 29, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.

Description of the PR

This PR adds sbt build file to build generated clients by akka-scala.

@ramzimaalej ramzimaalej changed the title Add build.sbt to Akka-scala [Akka-Scala] Add build.sbt to Akka-scala Nov 29, 2017
@wing328 wing328 added this to the v2.3.0 milestone Nov 30, 2017
@wing328
Copy link
Contributor

wing328 commented Nov 30, 2017

@ramzimaalej thanks for the enhancement.

I did a test withsbt test but it reported the following errors:

[error] missing or invalid dependency detected while loading class file 'BasicMarshallers.class'.
[error] Could not access type NodeSeq in value scala.xml,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'BasicMarshallers.class' was compiled against an incompatible version of scala.xml.
[error] (NOTE: It looks like the scala-xml module is missing; try adding a dependency on "org.scala-lang.modules" : "scala-xml".
[error]        See http://docs.scala-lang.org/overviews/ for more information.)
[warn] /private/tmp/swagger-codegen/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiInvoker.scala:244: abstract type T in type pattern scala.reflect.Manifest[T] (the underlying of Manifest[T]) is unchecked since it is eliminated by erasure
[warn]       case Some( (manifest: Manifest[T], state: ResponseState) ) =>
[warn]                             ^
[warn] one warning found
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 64 s, completed Nov 30, 2017 4:10:13 PM

But mvn clean test didn't report any issue so I'm not sure why...

@ramzimaalej
Copy link
Contributor Author

ramzimaalej commented Nov 30, 2017

@wing328 can you tell me which version of sbt and scala you used to test this. It works for me besides the warning

ascala_api_client sbt compile
[info] Set current project to swagger-client (in build file:/Users/rmaalej/Documents/dev/workspace/ascala_api_client/)
[info] Updating {file:/Users/rmaalej/Documents/dev/workspace/ascala_api_client/}ascala_api_client...
[info] Resolving jline#jline;2.12.1 ...
[info] downloading https://repo1.maven.org/maven2/org/json4s/json4s-jackson_2.10/3.2.11/json4s-jackson_2.10-3.2.11.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-jackson_2.10;3.2.11!json4s-jackson_2.10.jar (136ms)
[info] downloading https://repo1.maven.org/maven2/org/json4s/json4s-core_2.10/3.2.11/json4s-core_2.10-3.2.11.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-core_2.10;3.2.11!json4s-core_2.10.jar (273ms)
[info] downloading https://repo1.maven.org/maven2/org/json4s/json4s-ast_2.10/3.2.11/json4s-ast_2.10-3.2.11.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-ast_2.10;3.2.11!json4s-ast_2.10.jar (125ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scalap/2.11.8/scalap-2.11.8.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scalap;2.11.8!scalap.jar (300ms)
[info] Done updating.
[info] Compiling 10 Scala sources to /Users/rmaalej/Documents/dev/workspace/ascala_api_client/target/scala-2.11/classes...
[warn] /Users/rmaalej/Documents/dev/workspace/ascala_api_client/src/main/scala/io/swagger/client/core/ApiInvoker.scala:244: abstract type T in type pattern scala.reflect.Manifest[T] (the underlying of Manifest[T]) is unchecked since it is eliminated by erasure
[warn] case Some( (manifest: Manifest[T], state: ResponseState) ) =>
[warn] ^
[warn] /Users/rmaalej/Documents/dev/workspace/ascala_api_client/src/main/scala/io/swagger/client/core/ApiInvoker.scala:245: match may not be exhaustive.
[warn] It would fail on the following input: Left(UnsupportedContentType(_))
[warn] entityUnmarshaller(manifest)(response.entity) match {
[warn] ^
[warn] two warnings found
[success] Total time: 12 s, completed Nov 29, 2017 8:56:36 AM

➜ ascala_api_client sbt test
[info] Set current project to swagger-client (in build file:/Users/rmaalej/Documents/dev/workspace/ascala_api_client/)
[info] Run completed in 44 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[success] Total time: 1 s, completed Nov 30, 2017 1:18:04 PM

@wing328
Copy link
Contributor

wing328 commented Dec 1, 2017

$ java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)
$ scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

@ramzimaalej
Copy link
Contributor Author

@wing328 I was not able to reproduce the issue. Could run the same command with this flag -Ylog-classpath

@wing328
Copy link
Contributor

wing328 commented Dec 1, 2017

I'll add it to the CI to see if the CI reports similar issue.

@wing328 wing328 merged commit 61e706b into swagger-api:master Dec 1, 2017
@wing328
Copy link
Contributor

wing328 commented Dec 1, 2017

CircleCI reports the same error: https://circleci.com/gh/swagger-api/swagger-codegen/2827:

[info] Compiling 14 Scala sources to /home/ubuntu/swagger-codegen/samples/client/petstore/akka-scala/target/scala-2.11/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.11.8. Compiling...
[info]   Compilation completed in 16.894 s
[error] missing or invalid dependency detected while loading class file 'BasicMarshallers.class'.
[error] Could not access type NodeSeq in value scala.xml,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'BasicMarshallers.class' was compiled against an incompatible version of scala.xml.
[error] (NOTE: It looks like the scala-xml module is missing; try adding a dependency on "org.scala-lang.modules" : "scala-xml".
[error]        See http://docs.scala-lang.org/overviews/ for more information.)
[warn] /home/ubuntu/swagger-codegen/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiInvoker.scala:244: abstract type T in type pattern scala.reflect.Manifest[T] (the underlying of Manifest[T]) is unchecked since it is eliminated by erasure
[warn]       case Some( (manifest: Manifest[T], state: ResponseState) ) =>
[warn]                             ^
[warn] one warning found
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 58 s, completed Dec 1, 2017 4:20:51 AM
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (bundle-test) on project scala-akka-petstore-client: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

@ramzimaalej ramzimaalej deleted the sbt branch December 1, 2017 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants