Skip to content

Commit 09398a7

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ bindings/typescript/scip.ts linguist-generated=true
22
bindings/go/scip/scip.pb.go linguist-generated=true
33
bindings/rust/src/generated/scip.rs linguist-generated=true
44
bindings/haskell/src/Proto/**.hs linguist-generated=true
5-
bindings/java/src/main/java/scip/Scip.java linguist-generated=true
6-
bindings/kotlin/src/main/java/scip/Scip.java linguist-generated=true
7-
bindings/kotlin/src/main/kotlin/scip/**.kt linguist-generated=true
5+
bindings/java/src/main/java/org/scip_code/scip/**.java linguist-generated=true
6+
bindings/kotlin/src/main/java/org/scip_code/scip/**.java linguist-generated=true
7+
bindings/kotlin/src/main/kotlin/org/scip_code/scip/**.kt linguist-generated=true
88
docs/scip.md linguist-generated=true
99
yarn.lock linguist-generated=true

bindings/go/scip/scip.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)