bazelbuild / bazelbuild/bazel

Make Java source root configurable

Open
#6,353 8 comments 0 reactions 0 assignees View on GitHub
not stale P4 team-Rules-Java type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

Bazel hard-codes some conventions about Java source roots:

https://github.com/bazelbuild/bazel/blob/3aedb2f6de80630f88ffb6b60795c44e351a5810/src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java#L79

This is used e.g. to infer [`java_test.test_class`](https://docs.bazel.build/versions/master/be/java.html#java_test.test_class) and to relativize [`java_library.resources`](https://docs.bazel.build/versions/master/be/java.html#java_library.resources).

We should make the source root configurable to support other repository layouts.

Contributor guide

Open the contributing guide

Research direction

Start with src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java at the linked source-root convention. Trace how that convention is used for java_test.test_class and java_library.resources, then determine the configuration boundary needed for alternate repository layouts. Done means both behaviors respect a configurable Java source root, with the relevant tests updated or added.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.