Skip to content

Commit

Permalink
Integrate with mixer client. (envoyproxy#55)
Browse files Browse the repository at this point in the history
* Integrate with mixer client.

* Restore  repositories.bzl back.
  • Loading branch information
qiwzhang authored Jan 27, 2017
1 parent 92541b7 commit cea8827
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 237 deletions.
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",
"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

0 comments on commit cea8827

Please sign in to comment.