Skip to content

Commit

Permalink
chore: rework build infrastructure (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
chanseokoh authored Jan 27, 2022
1 parent 8ae5f31 commit 50a8693
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 104 deletions.
33 changes: 33 additions & 0 deletions PROPERTIES.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PROPERTIES = {
"version.com_google_protobuf": "3.19.1",
# Version of google-java-format is downgraded from 1.8 to 1.7, because 1.8 supports java 11 minimum, while our JRE is java 8.
"version.google_java_format": "1.7",
"version.com_google_api_common_java": "1.9.3",
"version.io_grpc_java": "1.42.1",

# Common deps.
"maven.com_google_guava_guava": "com.google.guava:guava:30.1-android",
"maven.com_google_code_findbugs_jsr305": "com.google.code.findbugs:jsr305:3.0.0",
"maven.com_google_auto_value_auto_value": "com.google.auto.value:auto-value:1.7.2",
"maven.com_google_auto_value_auto_value_annotations": "com.google.auto.value:auto-value-annotations:1.7.2",
"maven.com_google_code_gson": "com.google.code.gson:gson:2.8.6",
"maven.com_google_protobuf_protobuf_java": "com.google.protobuf:protobuf-java:3.19.1",
"maven.io_github_java_diff_utils": "io.github.java-diff-utils:java-diff-utils:4.0",
"maven.javax_annotation_javax_annotation_api": "javax.annotation:javax.annotation-api:1.3.2",
"maven.javax_validation_javax_validation_api": "javax.validation:validation-api:2.0.1.Final",

# Gapic YAML parsing for batching settings.
"maven.org_yaml_snakeyaml": "org.yaml:snakeyaml:1.26",

# ServiceStubSettings class. Used only in generated code.
"maven.org_threeten_threetenbp": "org.threeten:threetenbp:1.3.3",

# Testing.
"maven.junit_junit": "junit:junit:4.13.1",
# This hamcrest-core dependency is for running JUnit test manually, before JUnit 4.11 it's wrapped along with JUnit package.
# But now it has to be explicitly added.
"maven.org_hamcrest_hamcrest_core": "org.hamcrest:hamcrest-core:1.3",
"maven.org_mockito_mockito_core": "org.mockito:mockito-core:2.21.0",
# Keep in sync with gax-java.
"maven.com_google_truth_truth": "com.google.truth:truth:1.1.2",
}
8 changes: 0 additions & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ load("@com_google_api_gax_java//:repositories.bzl", "com_google_api_gax_java_rep

com_google_api_gax_java_repositories()

load("//:repository_rules.bzl", "gapic_generator_java_properties")

gapic_generator_java_properties(
name = "gapic_generator_java_properties",
file = "//:dependencies.properties",
)

load("@gapic_generator_java_properties//:dependencies.properties.bzl", "PROPERTIES")
load("//:repositories.bzl", "gapic_generator_java_repositories")

gapic_generator_java_repositories()
Expand Down
40 changes: 0 additions & 40 deletions dependencies.properties

This file was deleted.

2 changes: 1 addition & 1 deletion repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load("@gapic_generator_java_properties//:dependencies.properties.bzl", "PROPERTIES")
load("//:PROPERTIES.bzl", "PROPERTIES")

def gapic_generator_java_repositories():
# Import dependencies shared between Gradle and Bazel (i.e. maven dependencies)
Expand Down
49 changes: 0 additions & 49 deletions repository_rules.bzl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,9 @@ public void batchingDescriptor_noSubresponseField() {
}

private static Method findMethod(Service service, String methodName) {
for (Method m : service.methods()) {
if (m.name().equals(methodName)) {
return m;
}
}
return null;
return service.methods().stream()
.filter(m -> m.name().equals(methodName))
.findFirst()
.orElse(null);
}
}

0 comments on commit 50a8693

Please sign in to comment.