Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Code ends up generated into wrong directory #223

Closed
ghostbuster91 opened this issue Sep 15, 2020 · 11 comments
Closed

Code ends up generated into wrong directory #223

ghostbuster91 opened this issue Sep 15, 2020 · 11 comments

Comments

@ghostbuster91
Copy link

Screenshot from 2020-09-15 14-56-55

As you can see on the screenshot GreeterFs2Grpc is located under /fs2-grpc/examples/addressbook while it has a different package:

package examples.addressbook

import _root_.cats.implicits._

trait GreeterFs2Grpc[F[_], A] {
  def greet(request: examples.addressbook.Request, ctx: A): F[examples.addressbook.Response]
  def points(request: examples.addressbook.Request, ctx: A): _root_.fs2.Stream[F, examples.addressbook.Point]
  def bidi(request: _root_.fs2.Stream[F, examples.addressbook.Point], ctx: A): _root_.fs2.Stream[F, examples.addressbook.Response]
}

This prevents project from compiling.
scalaVersion = "2.12.10"
sbt = 1.3.8

@ahjohannessen
Copy link
Collaborator

The same happens with scalapb/examples/addressbook - where do you expect fs2-grpc/examples/addressbook to end up?

@ghostbuster91
Copy link
Author

Hmm, indeed, you are right, but somehow I am able to use code from scalapb/examples/addressbook and unable to use it from fs2-grpc/examples/addressbook.

In the begging I though that it should simply end up in examples/addressbook.

@ghostbuster91
Copy link
Author

I guess that the problem is the - in the name of the directory

@ahjohannessen
Copy link
Collaborator

Perhaps you could show some output from sbt - not sure what the issue is.

@ghostbuster91
Copy link
Author

ghostbuster91 commented Sep 15, 2020

I've just found out that the project compiles using sbt, but the code is not recognized by IntellijIdea:
Screenshot from 2020-09-15 17-01-26

@ahjohannessen
Copy link
Collaborator

What is that ServerBuilder? an alias for NettyServerBuilder ? Also, it might help IDEA to reload sbt projects (upper right sbt button) - or delete .idea folder from project and do a fresh import from existing sources in IDEA.

@ghostbuster91
Copy link
Author

ghostbuster91 commented Sep 15, 2020

ServerBuilder is from io.grpc

I did reload sbt project couple of times already.

Good idea, I will remove .idea directory and try again.

@ghostbuster91
Copy link
Author

Still the problem remains. If you take a closer look at my first screenshot, the directory with fs2-grpc has a different icon than scalapb directory

@ghostbuster91
Copy link
Author

ghostbuster91 commented Sep 16, 2020

Ok, so I checked it also against another project - bootzooka which uses scala 2.13 and the problem remains. You can check it out here: https://github.com/softwaremill/bootzooka/tree/fs2grpc-intellij-idea

This project also uses buildInfo plugin and I notice that it has similar problem - is not very well recognizable by intellij-idea. What they both have in common is the fact that they use - inside its directory name. Can we replace this character with _ to help IntellijIdea ?

Screenshot from 2020-09-16 12-14-11

@ahjohannessen
Copy link
Collaborator

I have made the path customizable here #224 - If it gets merged then you can customize the path by setting this in your project:

fs2GrpcOutputPath := (sourceManaged in Compile).value / "fs2_grpc"

@ghostbuster91
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants