bazel-contrib / bazel-contrib/rules_scala
scalapb_proto_library additional scala sources
Open
Nobody has claimed this yet.
- Dominant language
- Starlark
- Stars
- 384
- Forks
- 292
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 46
Description
Now it is impossible to add some custom scala sources into scalapb library. So i could not do something like this:
trait TagRecordCompanionTrait {
implicit val ordering: Ordering[TagRecord] = (x: TagRecord, y: TagRecord) => {
if (x.count < y.count) 1
else if (x.count > y.count) -1
else x.name compareTo y.name
}
}
message TagRecord {
option (scalapb.message).companion_extends = "TagRecordCompanionTrait";
required string name = 1;
required int64 count = 2;
}
The only way to do this is to use preamble in proto file
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the scalapb_proto_library rule and compare its current source inputs with the preamble-based workaround described in the issue. Trace how custom Scala sources are passed into the generated library, then verify that a companion extension such as TagRecordCompanionTrait can be supplied without using a proto preamble.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100