Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish separate scip-java-proto artifact with scip.proto generated classes #523

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

olafurpg
Copy link
Member

@olafurpg olafurpg commented Nov 23, 2022

Fixes #522

Previously, it was necessary to generate classes from the scip.proto source if you wanted to write Java tooling that consumes SCIP. This commit reorganizes the build so that we publish a new
com.sourcegraph:scip-java-proto artifact that only includes the generated protobuf classes from scip.proto. Note that we don't guarantee binary compatibility for public classes in this module.

Test plan

See the CI go live. I ran sbt scipProto/publishLocal and verified that the published artifact has minimal classes and minimal dependencies.

❯ cs fetch com.sourcegraph:scip-java-proto:0.8.8-2-7aafce0c-20221123-1609-SNAPSHOT
/Users/olafurpg/.ivy2/local/com.sourcegraph/scip-java-proto/0.8.8-2-7aafce0c-20221123-1609-SNAPSHOT/jars/scip-java-proto.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.15.6/protobuf-java-3.15.6.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.15.6/protobuf-java-util-3.15.6.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/guava/guava/30.0-android/guava-30.0-android.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar
/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar

The protobuf dependencies are unavoidable.

❯ jar tf /Users/olafurpg/.ivy2/local/com.sourcegraph/scip-java-proto/0.8.8-2-7aafce0c-20221123-1609-SNAPSHOT/jars/scip-java-proto.jar
META-INF/MANIFEST.MF
com/
com/sourcegraph/
com/sourcegraph/Scip$1.class
com/sourcegraph/Scip$Descriptor$1.class
com/sourcegraph/Scip$Descriptor$Builder.class
com/sourcegraph/Scip$Descriptor$Suffix$1.class
com/sourcegraph/Scip$Descriptor$Suffix.class
com/sourcegraph/Scip$Descriptor.class
com/sourcegraph/Scip$DescriptorOrBuilder.class
com/sourcegraph/Scip$Diagnostic$1.class
com/sourcegraph/Scip$Diagnostic$2.class
com/sourcegraph/Scip$Diagnostic$Builder.class
com/sourcegraph/Scip$Diagnostic.class
com/sourcegraph/Scip$DiagnosticOrBuilder.class
com/sourcegraph/Scip$DiagnosticTag$1.class
com/sourcegraph/Scip$DiagnosticTag.class
com/sourcegraph/Scip$Document$1.class
com/sourcegraph/Scip$Document$Builder.class
com/sourcegraph/Scip$Document.class
com/sourcegraph/Scip$DocumentOrBuilder.class
com/sourcegraph/Scip$Index$1.class
com/sourcegraph/Scip$Index$Builder.class
com/sourcegraph/Scip$Index.class
com/sourcegraph/Scip$IndexOrBuilder.class
com/sourcegraph/Scip$Metadata$1.class
com/sourcegraph/Scip$Metadata$Builder.class
com/sourcegraph/Scip$Metadata.class
com/sourcegraph/Scip$MetadataOrBuilder.class
com/sourcegraph/Scip$Occurrence$1.class
com/sourcegraph/Scip$Occurrence$Builder.class
com/sourcegraph/Scip$Occurrence.class
com/sourcegraph/Scip$OccurrenceOrBuilder.class
com/sourcegraph/Scip$Package$1.class
com/sourcegraph/Scip$Package$Builder.class
com/sourcegraph/Scip$Package.class
com/sourcegraph/Scip$PackageOrBuilder.class
com/sourcegraph/Scip$ProtocolVersion$1.class
com/sourcegraph/Scip$ProtocolVersion.class
com/sourcegraph/Scip$Relationship$1.class
com/sourcegraph/Scip$Relationship$Builder.class
com/sourcegraph/Scip$Relationship.class
com/sourcegraph/Scip$RelationshipOrBuilder.class
com/sourcegraph/Scip$Severity$1.class
com/sourcegraph/Scip$Severity.class
com/sourcegraph/Scip$Symbol$1.class
com/sourcegraph/Scip$Symbol$Builder.class
com/sourcegraph/Scip$Symbol.class
com/sourcegraph/Scip$SymbolInformation$1.class
com/sourcegraph/Scip$SymbolInformation$Builder.class
com/sourcegraph/Scip$SymbolInformation.class
com/sourcegraph/Scip$SymbolInformationOrBuilder.class
com/sourcegraph/Scip$SymbolOrBuilder.class
com/sourcegraph/Scip$SymbolRole$1.class
com/sourcegraph/Scip$SymbolRole.class
com/sourcegraph/Scip$SyntaxKind$1.class
com/sourcegraph/Scip$SyntaxKind.class
com/sourcegraph/Scip$TextEncoding$1.class
com/sourcegraph/Scip$TextEncoding.class
com/sourcegraph/Scip$ToolInfo$1.class
com/sourcegraph/Scip$ToolInfo$Builder.class
com/sourcegraph/Scip$ToolInfo.class
com/sourcegraph/Scip$ToolInfoOrBuilder.class
com/sourcegraph/Scip.class
scip.proto

Verified

This commit was signed with the committer’s verified signature.
nicolo-ribaudo Nicolò Ribaudo
…lasses

Fixes #522

Previously, it was necessary to generate classes from the scip.proto source
if you wanted to write Java tooling that consumes SCIP. This commit
reorganizes the build so that we publish a new
com.sourcegraph:scip-java-proto artifact that only includes the
generated protobuf classes from scip.proto. Note that we don't guarantee
binary compatibility for public classes in this module.
@olafurpg olafurpg changed the title Publish separate scip-java-proto artifact with scip.proto generated c… Publish separate scip-java-proto artifact with scip.proto generated classes Nov 23, 2022
@olafurpg olafurpg requested a review from Strum355 November 23, 2022 15:17

Verified

This commit was signed with the committer’s verified signature.
nicolo-ribaudo Nicolò Ribaudo
@olafurpg olafurpg enabled auto-merge November 23, 2022 15:26
@olafurpg olafurpg merged commit 3725605 into main Nov 23, 2022
@olafurpg olafurpg deleted the olafurpg/scip-java branch November 23, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish Java classes generated from scip.proto as a separate Maven artifact
2 participants