Skip to content

Commit

Permalink
Merge pull request #523 from sourcegraph/olafurpg/scip-java
Browse files Browse the repository at this point in the history
Publish separate scip-java-proto artifact with scip.proto generated classes
  • Loading branch information
olafurpg authored Nov 23, 2022
2 parents 7aafce0 + da30835 commit 3725605
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
17 changes: 14 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,30 @@ lazy val plugin = project
)
.dependsOn(semanticdb)

lazy val scipProto = project
.in(file("scip-java-proto"))
.settings(
moduleName := "scip-java-proto",
javaToolchainVersion := "8",
javaOnlySettings,
libraryDependencies +=
"com.google.protobuf" % "protobuf-java-util" % V.protobuf,
(Compile / PB.targets) :=
Seq(PB.gens.java(V.protobuf) -> (Compile / sourceManaged).value),
Compile / PB.protocOptions := Seq("--experimental_allow_proto3_optional")
)

lazy val scip = project
.in(file("scip-semanticdb"))
.settings(
moduleName := "scip-semanticdb",
javaToolchainVersion := "8",
javaOnlySettings,
libraryDependencies +=
"com.google.protobuf" % "protobuf-java-util" % V.protobuf,
(Compile / PB.targets) :=
Seq(PB.gens.java(V.protobuf) -> (Compile / sourceManaged).value),
Compile / PB.protocOptions := Seq("--experimental_allow_proto3_optional")
)
.dependsOn(semanticdb)
.dependsOn(semanticdb, scipProto)

lazy val cli = project
.in(file("scip-java"))
Expand Down
16 changes: 16 additions & 0 deletions scip-java-proto/src/main/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@rules_java//java:defs.bzl", "java_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

package(
default_visibility = ["//visibility:public"],
)

java_proto_library(
name = "scip_java_proto",
deps = [":scip_proto"],
)

proto_library(
name = "scip_proto",
srcs = ["scip.proto"],
)
1 change: 1 addition & 0 deletions scip-semanticdb/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ java_library(
srcs = glob(["src/main/java/**/*.java"]),
deps = [
":all_java_proto",
"//scip-java-proto/src/main/protobuf:scip_java_proto",
"//semanticdb-java",
"//semanticdb-java/src/main/protobuf:semanticdb_java_proto",
"@maven//:com_google_protobuf_protobuf_java",
Expand Down

0 comments on commit 3725605

Please sign in to comment.