-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update bazel version and dependencies (#22)
* Update bazel version and dependencies - Update bazel to 3.1.0 - Upgrade bazel-based deps to work with 3.1.0 - Upgrade jar deps to newest version to avoid conflict with bazel-based deps - Update tests, removing deprecated methods and - Remove unneeded deps * make test server names private * Use official grpc-java rules for building grpc libs for java Also removes now unneeded third party grpc rules * Use grpc-java targets as deps rather than maven artifacts
- Loading branch information
Showing
20 changed files
with
1,117 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
test --legacy_bazel_java_test | ||
test --test_output=errors | ||
test --test_output=errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ bazel-* | |
project.iml | ||
output | ||
*.swp | ||
.ijwb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,55 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "org_pubref_rules_protobuf", | ||
strip_prefix = "rules_protobuf-0.8.1", | ||
urls = ["https://github.com/pubref/rules_protobuf/archive/v0.8.1.zip"], | ||
name = "io_grpc_grpc_java", | ||
sha256 = "446ad7a2e85bbd05406dbf95232c7c49ed90de83b3b60cb2048b0c4c9f254d29", | ||
strip_prefix = "grpc-java-1.29.0", | ||
url = "https://github.com/grpc/grpc-java/archive/v1.29.0.zip", | ||
) | ||
|
||
load("@org_pubref_rules_protobuf//java:rules.bzl", "java_proto_repositories") | ||
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS") | ||
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS") | ||
|
||
java_proto_repositories() | ||
RULES_JVM_EXTERNAL_TAG = "3.0" | ||
|
||
maven_jar( | ||
name = "io_grpc_grpc_benchmarks", | ||
artifact = "io.grpc:grpc-benchmarks:1.6.1", | ||
) | ||
RULES_JVM_EXTERNAL_SHA = "62133c125bf4109dfd9d2af64830208356ce4ef8b165a6ef15bbff7460b35c3a" | ||
|
||
maven_jar( | ||
name = "io_grpc_grpc_okhttp", | ||
artifact = "io.grpc:grpc-okhttp:1.6.1", | ||
http_archive( | ||
name = "rules_jvm_external", | ||
sha256 = RULES_JVM_EXTERNAL_SHA, | ||
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, | ||
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, | ||
) | ||
|
||
maven_jar( | ||
name = "grpc_testing_artifact", | ||
artifact = "io.grpc:grpc-testing:1.4.0", | ||
) | ||
load("@rules_jvm_external//:defs.bzl", "maven_install") | ||
load("//:repositories.bzl", "MAVEN_ARTIFACTS") | ||
|
||
maven_jar( | ||
name = "guava_artifact", | ||
artifact = "com.google.guava:guava:21.0", | ||
maven_install( | ||
artifacts = MAVEN_ARTIFACTS + IO_GRPC_GRPC_JAVA_ARTIFACTS, | ||
generate_compat_repositories = True, | ||
maven_install_json = "//:maven_install.json", | ||
override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS, | ||
repositories = [ | ||
"https://jcenter.bintray.com/", | ||
"https://maven.google.com", | ||
"https://repo1.maven.org/maven2", | ||
], | ||
) | ||
|
||
maven_jar( | ||
name = "junit_artifact", | ||
artifact = "junit:junit:4.10", | ||
) | ||
load("@maven//:defs.bzl", "pinned_maven_install") | ||
|
||
maven_jar( | ||
name = "netty_artifact", | ||
artifact = "io.netty:netty-all:4.1.13.Final", | ||
) | ||
pinned_maven_install() | ||
|
||
maven_jar( | ||
name = "protobuf_java_artifact", | ||
artifact = "com.google.protobuf:protobuf-java:3.2.0" | ||
) | ||
load("@maven//:compat.bzl", "compat_repositories") | ||
|
||
maven_jar( | ||
name = "protobuf_java_util_artifact", | ||
artifact = "com.google.protobuf:protobuf-java-util:3.2.0", | ||
) | ||
compat_repositories() | ||
|
||
maven_jar( | ||
name = "mockito_artifact", | ||
artifact = "org.mockito:mockito-all:1.10.19", | ||
) | ||
load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories") | ||
|
||
maven_jar( | ||
name = "prometheus_client_artifact", | ||
artifact = "io.prometheus:simpleclient:0.0.14", | ||
) | ||
# Run grpc_java_repositories after compat_repositories to ensure the | ||
# maven_install-selected dependencies are used. | ||
grpc_java_repositories() | ||
|
||
maven_jar( | ||
name = "truth_artifact", | ||
artifact = "com.google.truth:truth:0.28", | ||
) | ||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") | ||
|
||
protobuf_deps() |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MAVEN_ARTIFACTS = [ | ||
"com.google.guava:guava:29.0-jre", | ||
"junit:junit:4.10", | ||
"com.google.protobuf:protobuf-java:3.12.1", | ||
"com.google.protobuf:protobuf-java-util:3.12.1", | ||
"org.mockito:mockito-all:1.10.19", | ||
"io.prometheus:simpleclient:0.9.0", | ||
"com.google.truth:truth:1.0.1", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
load("@org_pubref_rules_protobuf//java:rules.bzl", "java_proto_library") | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") | ||
load("@rules_java//java:defs.bzl", "java_proto_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
proto_library( | ||
name = "hello_proto", | ||
srcs = ["hello.proto"], | ||
) | ||
|
||
java_proto_library( | ||
name = "hello_proto_grpc", | ||
protos = ["hello.proto"], | ||
with_grpc = True, | ||
name = "hello_java_proto", | ||
deps = [":hello_proto"], | ||
) | ||
|
||
java_grpc_library( | ||
name = "hello_proto_grpc", | ||
srcs = [":hello_proto"], | ||
deps = [":hello_java_proto"], | ||
) |
27 changes: 24 additions & 3 deletions
27
src/test/java/me/dinowernli/grpc/prometheus/integration/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.