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

Integrate with mixer client. #55

Merged
merged 2 commits into from
Jan 27, 2017
Merged
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
22 changes: 20 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,34 @@ googletest_repositories()
load(
"//contrib/endpoints:repositories.bzl",
"grpc_repositories",
"mixerapi_repositories",
"mixer_client_repositories",
"servicecontrol_client_repositories",
)

grpc_repositories()

mixerapi_repositories()
mixer_client_repositories()

servicecontrol_client_repositories()

# Workaround for Bazel > 0.4.0 since it needs newer protobuf.bzl from:
# https://github.com/google/protobuf/pull/2246
# Do not use this git_repository for anything else than protobuf.bzl
new_git_repository(
name = "protobuf_bzl",
# Injecting an empty BUILD file to prevent using any build target
build_file_content = "",
commit = "05090726144b6e632c50f47720ff51049bfcbef6",
remote = "https://github.com/google/protobuf.git",
)

load(
"@mixerclient_git//:repositories.bzl",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load as little as possible from @mixerclient_git//:repositories.bzl

BoringSSL has to be compatible with the version required from envoy, mixerclient has little thing to do with version compatibilities. same for grpc/protobuf/googletest/googleapis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"mixerapi_repositories",
)

mixerapi_repositories(protobuf_repo="@protobuf_bzl//")

load(
"//src/envoy:repositories.bzl",
"envoy_repositories",
Expand Down
52 changes: 8 additions & 44 deletions contrib/endpoints/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -334,51 +334,15 @@ def servicecontrol_client_repositories(bind=True):
actual = "@servicecontrol_client_git//:service_control_client_lib",
)

def mixerapi_repositories(protobuf_repo="@protobuf_git//", bind=True):
BUILD = """
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
#
licenses(["notice"])

load("{}:protobuf.bzl", "cc_proto_library")

cc_proto_library(
name = "mixer_api_cc_proto",
srcs = glob(
["mixer/api/v1/*.proto"],
),
default_runtime = "//external:protobuf",
protoc = "//external:protoc",
visibility = ["//visibility:public"],
deps = [
"//external:cc_wkt_protos",
"//external:servicecontrol",
],
)
""".format(protobuf_repo)

native.new_git_repository(
name = "mixerapi_git",
commit = "fc5a396185edc72d06d1937f30a8148a37d4fc1b",
remote = "https://github.com/istio/api.git",
build_file_content = BUILD,
def mixer_client_repositories(bind=True):
native.git_repository(
name = "mixerclient_git",
commit = "1569430f1e27b31e23c029c6bec0d8d5062d9e55",
remote = "https://github.com/istio/mixerclient.git",
)

if bind:
native.bind(
name = "mixer_api_cc_proto",
actual = "@mixerapi_git//:mixer_api_cc_proto",
name = "mixer_client_lib",
actual = "@mixerclient_git//:mixer_client_lib",
)
6 changes: 3 additions & 3 deletions contrib/endpoints/src/api_manager/mixer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ cc_library(
],
}),
deps = [
"//external:grpc++",
"//external:mixer_api_cc_proto",
"//external:protobuf",
"//contrib/endpoints/src/api_manager:impl_headers",
"//contrib/endpoints/src/api_manager/service_control",
"//contrib/endpoints/src/api_manager/utils",
"//external:grpc++",
"//external:mixer_client_lib",
"//external:protobuf",
],
)
Loading