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

How do you import the project into intellij? #311

Closed
Sineaggi opened this issue Feb 14, 2022 · 4 comments
Closed

How do you import the project into intellij? #311

Sineaggi opened this issue Feb 14, 2022 · 4 comments

Comments

@Sineaggi
Copy link

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

@nick-someone
Copy link
Member

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)

@Sineaggi
Copy link
Author

@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.

@nick-someone
Copy link
Member

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

@Sineaggi
Copy link
Author

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

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