Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Nice to include source directories of dependencies in super dev mode #8

Open
solomatov opened this issue Dec 15, 2016 · 5 comments
Open

Comments

@solomatov
Copy link

Current, they are included as binary dependencies, which makes them hard to use especially if you have a large multi module project.

Thanks,
Kostya

@ekuefler
Copy link
Contributor

Could you describe your project layout a bit more and how you're expecting things to work? The default assumption is that your Java sources are all under java/ or src/main/java/. If that's not the case, you can set java_roots in your gwt_application, which can include multiple paths. So if you have a workspace structured like this:

WORKSPACE
FooModule/
  src/
    com/
      mycompany/
        Foo.java
BarModule/
  src/
    com/
      mycompany/
        Bar.java

Then you would set java_roots in your gwt_application to ["FooModule/src/", "BarModule/src/"]. I've only done a small amount of testing with multiple source roots, so let me know if there are any problems with it.

@solomatov
Copy link
Author

@ekuefler We have a large project with many modules: we have different UI components, UI framework , etc. We prefer to develop parts, while working in gwt super dev mode on concrete applications. Due to the project size it's unpractical to put everything into one module.

@solomatov
Copy link
Author

@ekuefler You can find open source part of our app converted to bazel here: https://github.com/JetBrains/jetpad-mapper/tree/bazel

@ekuefler
Copy link
Contributor

That makes sense. Does the java_roots solution not work for you? If I'm understanding your project structure correctly, that would involve modifying https://github.com/JetBrains/jetpad-mapper/blob/bazel/samples/todo/BUILD to add

java_roots = [
  "gwt-util/src/main/java/",
  "mappers/src/main/java/",
  "model/src/main/java/",
  "sample/todo/src/main/java/",
]

I agree that it's annoying having to maintain this in parallel with the deps. Currently we need this information to figure out where the actual source files (not just a srcjar containing them) are on your filesystem so GWT can detect changes to them without having to re-run Bazel. If you don't include a root then super dev mode will still work, but changes to those files won't be visible until you restart it.

It might be possible to somehow try to infer the roots from the dependencies that are known to Bazel, but last time I looked it seemed like there wasn't a good way to do that (and it might be impossible in general - if all you see is foobar/src/Baz.java, there's no way to tell if Baz belongs to package foobar.src, src, or the default package).

@solomatov
Copy link
Author

@ekuefler java_roots works in this situation, but it's just a tip of the iceberg. We have 2 more repositories in our project (they aren't open source), and the whole application might end up with more than a 100 of source folders which are hard to update, since we change the project structure from time to time.

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

No branches or pull requests

2 participants