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

fix(bazel): Replace monolith deps with rules_gapic [ggj] #758

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ http_archive(
jvm_maven_import_external(
name = "google_java_format_all_deps",
artifact = "com.google.googlejavaformat:google-java-format:jar:all-deps:1.7",
server_urls = ["https://repo.maven.apache.org/maven2/", "http://repo1.maven.org/maven2/"],
licenses = ["notice", "reciprocal"]
licenses = [
"notice",
"reciprocal",
],
server_urls = [
"https://repo.maven.apache.org/maven2/",
"http://repo1.maven.org/maven2/",
],
)

# gax-java and its transitive dependencies must be imported before
Expand Down Expand Up @@ -62,14 +68,6 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

# Java dependencies.
# Import the monolith so we can transitively use its gapic rules for googleapis.
http_archive(
name = "com_google_api_codegen",
strip_prefix = "gapic-generator-2.11.1",
urls = ["https://github.com/googleapis/gapic-generator/archive/v2.11.1.zip"],
)

load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")

switched_rules_by_language(
Expand All @@ -88,3 +86,11 @@ http_archive(
strip_prefix = "disco-to-proto3-converter-1839f6aca5e968e59b7acc03e7018b0fda8c480b",
urls = ["https://github.com/googleapis/disco-to-proto3-converter/archive/1839f6aca5e968e59b7acc03e7018b0fda8c480b.zip"],
)

_rules_gapic_version = "0.5.4"

http_archive(
name = "rules_gapic",
strip_prefix = "rules_gapic-%s" % _rules_gapic_version,
urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version],
)
4 changes: 2 additions & 2 deletions dependencies.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# The properties format is the following:
# <dependency_type>[.<artifact_name>]=<value>

# Target workspace name: com_google_api_codegen
# Target workspace name: gapic_generator_java

# Versions only, for dependencies which actual artifacts differ between Bazel and Gradle
version.com_google_protobuf=3.15.2
Expand Down Expand Up @@ -32,7 +32,7 @@ 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.
# 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
Expand Down
2 changes: 1 addition & 1 deletion rules_java_gapic/java_gapic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@com_google_api_codegen//rules_gapic:gapic.bzl", "proto_custom_library", "unzipped_srcjar")
load("@rules_gapic//:gapic.bzl", "proto_custom_library", "unzipped_srcjar")

SERVICE_YAML_ALLOWLIST = ["clouddms", "cloudkms", "datastream", "pubsub"]
NO_GRPC_CONFIG_ALLOWLIST = ["library"]
Expand Down