Commit 09398a7
committed
Polish JVM bindings per code review feedback
Addresses five concerns about the initial Java/Kotlin bindings:
1. Use a conventional reverse-DNS Java package. The bare 'package scip;'
collided with the outer class name 'Scip' (FQN 'scip.Scip') and
confused tools like Bazel java_proto_library strict-deps, ProGuard/R8,
and OSGi. Set java_package to 'org.scip_code.scip' (matching the
verified scip-code.org domain), so messages live at FQNs like
'org.scip_code.scip.Index'.
2. Set java_multiple_files = true. Previously the entire ~23k-line
generated output sat inside one outer 'Scip' class, forcing
nested-class call sites like Scip.Index.newBuilder(). With
multiple-files, each message becomes its own top-level class:
'import org.scip_code.scip.Index'. Picked now because this is a
wire-compatible source-API change but very expensive to flip
post-1.0. Also set java_outer_classname = 'ScipProto' so the
file-level descriptor holder doesn't collide with any 'Scip*'
message names that the new layout exposes.
3. Declare protobuf-java-util as a dependency in both poms. JsonFormat
and the related util classes are something most real-world consumers
eventually reach for; declaring it transitively saves them from
discovering the missing dep at runtime via NoClassDefFoundError.
4. Ship the canonical scip.proto schema as a Maven classifier artifact
in both bindings (e.g. 'mvn dependency:get
org.scip-code:scip-java:0.7.1:proto:proto'), so Bazel/Buck/Pants
users and consumers generating bindings in another language can pull
the schema directly instead of vendoring it. Implemented via
build-helper-maven-plugin's attach-artifact goal, with
proto-generate copying scip.proto into bindings/{java,kotlin}/src/
main/proto/scip.proto so the Maven build can find it. The copies
are excluded from buf's input set in buf.yaml to avoid duplicate
top-level proto symbols.
5. Document the protobuf 4 gencode-vs-runtime compatibility window in
per-binding READMEs (new bindings/{java,kotlin}/README.md). Pinning
protobuf-java to a strict version was rejected because it would
break Maven/Gradle dependency convergence with consumers using a
newer 4.x; using a version range was rejected because it would
break Nix mvnHash determinism. Documenting the upgrade direction
is the established protobuf-project recommendation.
Side effects:
* The haskell and rust bindings get regenerated to reflect the new
option ordering in scip.proto (alphabetized to satisfy buf format).
Only embedded file descriptors / line numbers shift; no API
changes.
* .gitattributes patterns updated for the new java_multiple_files
layout under org/scip_code/scip/.
* checks.nix mvnHash refreshed to account for the new
protobuf-java-util and build-helper-maven-plugin deps.1 parent 9c41419 commit 09398a7
96 files changed
Lines changed: 51545 additions & 48923 deletions
File tree
- bindings
- go/scip
- haskell/src/Proto
- java
- src/main
- java
- org/scip_code/scip
- scip
- proto
- kotlin
- src/main
- java
- org/scip_code/scip
- scip
- kotlin/org/scip_code/scip
- proto
- rust/src/generated
- typescript
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments