bazel-contrib / bazel-contrib/rules_scala

How to integrate scala_import

Open
#370 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
384
Forks
292
Avg merge
2d 21h
Merged PRs (30d)
46

Description

I'm opening this ticket to discuss details of using `scala_import` with IntelliJ. Having the discussion in public will make it easier to Google for other people.

Scala rules have `scala_import` that is supposed to mirror `java_import`. Another feature of `scala_import` is that it carries information that IntelliJ plugin lookups to determine dependencies.

I'm working on adding support for `scala_import` to bazel-deps and I hit some snags. Questions:
1. Should both java and scala go through `*_import` rules? At the moment, bazel-deps uses `java_library` for exposing java jars (fetched with maven_artifact) and `scala_library` for scala jars. For consistency reasons, it feels like we should just use import rules
2. What's the exact dependency of a `java_import`? is it a file group like `@com_google_guava_guava//jar:file` or `@com_google_guava_guava//jar`? What's better for IntelliJ?
3. How are transitive dependencies supposed to be expressed? My understanding is that they should be exposed as exports for both java and scala dependencies. Is that right?
4. Does resolution of source artifacts work for both java and scala dependencies in IntelliJ?

Contributor guide

Open the contributing guide

Research direction

Start by reading the scala_import and java_import rule definitions and the IntelliJ dependency lookup behavior. Compare those expectations with bazel-deps targets built from java_library, scala_library, and maven_artifact. Done means the project has agreed guidance for import targets, dependency and export structure, transitive dependencies, and source artifact resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.