google/flogger

How do you import the project into intellij?

Sineaggi opened this issue · 4 comments

Is there a simple way to get intellij to import this bazel project?

https://ij.bazel.build/ is a Bazel plugin if you're looking to develop on Bazel projects in IntelliJ.

If you're just trying to use Flogger as a dependency in your project, you should be able to depend on it like most other Maven artifacts (https://github.com/google/flogger#how-to-use-flogger)

@nick-someone I should have added more detail. Its not clear to me how to use the Bazel plugin to import flogger into Intellij, as the steps aren't super clear in this project's case.

Specifically, from the documentation https://ij.bazel.build/docs/import-project.html you need either a file called a bazelproject, or the tool can automatically generate one from a 'main BUILD file'. Unfortunately flogger has neither a bazelproject file or a root BUILD file, only a root workspace.

Ah, I see what you mean. There is not a top-level BUILD file, as you noticed. However, there are BUILD rules at each subdirectory, so you can configure the bazel project to include:

directories:
  .

targets: 
  //...

and I believe that should do it

Thanks, it looks like that worked!

To other people who may be looking at this issue, the contents of my .bazelproject are

directories:
  .

targets: 
  //...

workspace_type: java