Restore loading ScalaPB protoc plugin directly

This commit is contained in:
Adam Liddell 2020-09-30 10:42:12 +00:00
parent 63638ee308
commit d1075ebf81
11 changed files with 51 additions and 66 deletions

View File

@ -15,6 +15,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()

View File

@ -15,6 +15,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()

View File

@ -15,6 +15,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()

View File

@ -15,6 +15,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()

View File

@ -214,34 +214,16 @@ VERSIONS = {
"type": "github",
"org": "bazelbuild",
"repo": "rules_scala",
"ref": "19295567e10e80349560a437c79e8f859c2a5a79",
"sha256": "8f1001610e80972ee1e68ddca7a497e21b5b1c1f7ddfaf8f6e0557936daa4ad8",
"ref": "6280cdbdb03bbace36e5458ca73745b80a9fe467",
"sha256": "723ac4c2eda86c6a5d9cbe64bde36f17185e7205acf8064a2b8bb1aea2fbf831",
},
"com_github_scalapb_scalapb": {
"type": "http",
"urls": ["https://github.com/scalapb/ScalaPB/releases/download/v0.9.4/scalapbc-0.9.4.zip"],
"sha256": "7fe84b201195cd437c4393d882d08cb6354f6f24804c2a782a5c3379a2beb48d",
"strip_prefix": "scalapbc-0.9.4",
"urls": ["https://github.com/scalapb/ScalaPB/releases/download/v0.9.7/scalapbc-0.9.7.zip"], # Matches version in https://github.com/bazelbuild/rules_scala/blob/master/scala_proto/private/scala_proto_default_repositories.bzl
"sha256": "623f626e97cca119b2a12c4e1d9a3c85aab9f9fd6dcb8dc22b4f704b824da94e",
"strip_prefix": "scalapbc-0.9.7",
"build_file": "@rules_proto_grpc//third_party:BUILD.bazel.com_github_scalapb_scalapb",
},
"scalapb_runtime": {
"type": "jvm_maven_import_external",
"artifact": "com.thesamet.scalapb:scalapb-runtime_2.12:jar:0.9.4",
"server_urls": ["https://repo.maven.apache.org/maven2"],
"artifact_sha256": "151b9e353980bc266d4630ed1c2792712e109b02942211115afe97232b15f694",
},
"scalapb_runtime_grpc": {
"type": "jvm_maven_import_external",
"artifact": "com.thesamet.scalapb:scalapb-runtime-grpc_2.12:jar:0.9.4",
"server_urls": ["https://repo.maven.apache.org/maven2"],
"artifact_sha256": "249467665168edf58690e81af17b1efb4fbdfd1c68f63b035c1ee5cbdc206eae",
},
"scalapb_lenses": {
"type": "jvm_maven_import_external",
"artifact": "com.thesamet.scalapb:lenses_2.12:jar:0.9.4",
"server_urls": ["https://repo.maven.apache.org/maven2"],
"artifact_sha256": "51a82005e64c15690aabfa1641047e584b98eb01157930639c83ecea55d32b42",
},
# Swift
"com_github_apple_swift_swift_protobuf": {
@ -508,15 +490,6 @@ def io_bazel_rules_scala(**kwargs):
def com_github_scalapb_scalapb(**kwargs):
_generic_dependency("com_github_scalapb_scalapb", **kwargs)
def scalapb_runtime(**kwargs):
_generic_dependency("scalapb_runtime", **kwargs)
def scalapb_runtime_grpc(**kwargs):
_generic_dependency("scalapb_runtime_grpc", **kwargs)
def scalapb_lenses(**kwargs):
_generic_dependency("scalapb_lenses", **kwargs)
#
# Swift

View File

@ -26,6 +26,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
@ -68,6 +72,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
@ -112,6 +120,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
@ -154,6 +166,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()

View File

@ -3,9 +3,6 @@ load(
"com_github_scalapb_scalapb",
"io_bazel_rules_scala",
"io_grpc_grpc_java",
"scalapb_runtime",
"scalapb_runtime_grpc",
"scalapb_lenses",
"rules_proto_grpc_repos",
)
@ -13,7 +10,4 @@ def scala_repos(**kwargs):
rules_proto_grpc_repos(**kwargs)
io_grpc_grpc_java(**kwargs)
com_github_scalapb_scalapb(**kwargs)
scalapb_runtime(**kwargs)
scalapb_runtime_grpc(**kwargs)
scalapb_lenses(**kwargs)
io_bazel_rules_scala(**kwargs)

View File

@ -19,12 +19,6 @@ def scala_grpc_library(**kwargs):
)
GRPC_DEPS = [
"@scalapb_runtime//jar",
"@scalapb_runtime_grpc//jar",
"@scalapb_lenses//jar",
"@com_google_protobuf//:protobuf_java",
"@io_grpc_grpc_java//api",
"@io_grpc_grpc_java//protobuf",
"@io_grpc_grpc_java//stub",
"@com_google_guava_guava//jar",
"@io_bazel_rules_scala//scala_proto:default_scalapb_compile_dependencies",
"@io_bazel_rules_scala//scala_proto:default_scalapb_grpc_dependencies",
]

View File

@ -19,7 +19,5 @@ def scala_proto_library(**kwargs):
)
PROTO_DEPS = [
"@scalapb_runtime//jar",
"@scalapb_lenses//jar",
"@com_google_protobuf//:protobuf_java",
"@io_bazel_rules_scala//scala_proto:default_scalapb_compile_dependencies",
]

View File

@ -1,7 +1 @@
exports_files(["bin/protoc-gen-scala", "bin/protoc-gen-scala.bat"])
java_import(
name = "scala_library",
jars = ["lib/org.scala-lang.scala-library-2.11.12.jar"],
visibility = ["//visibility:public"],
)

View File

@ -8,6 +8,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()`)
@ -20,6 +24,10 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
scala_proto_repositories()
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
@ -51,9 +59,7 @@ var scalaProtoLibraryRuleTemplate = mustTemplate(scalaLibraryRuleTemplateString
)
PROTO_DEPS = [
"@scalapb_runtime//jar",
"@scalapb_lenses//jar",
"@com_google_protobuf//:protobuf_java",
"@io_bazel_rules_scala//scala_proto:default_scalapb_compile_dependencies",
]`)
var scalaGrpcLibraryRuleTemplate = mustTemplate(scalaLibraryRuleTemplateString + `
@ -67,14 +73,8 @@ var scalaGrpcLibraryRuleTemplate = mustTemplate(scalaLibraryRuleTemplateString +
)
GRPC_DEPS = [
"@scalapb_runtime//jar",
"@scalapb_runtime_grpc//jar",
"@scalapb_lenses//jar",
"@com_google_protobuf//:protobuf_java",
"@io_grpc_grpc_java//api",
"@io_grpc_grpc_java//protobuf",
"@io_grpc_grpc_java//stub",
"@com_google_guava_guava//jar",
"@io_bazel_rules_scala//scala_proto:default_scalapb_compile_dependencies",
"@io_bazel_rules_scala//scala_proto:default_scalapb_grpc_dependencies",
]`)
func makeScala() *Language {