Skip to content

Commit cea8827

Browse files
authored
Integrate with mixer client. (istio#55)
* Integrate with mixer client. * Restore repositories.bzl back.
1 parent 92541b7 commit cea8827

File tree

8 files changed

+129
-237
lines changed

8 files changed

+129
-237
lines changed

WORKSPACE

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,34 @@ googletest_repositories()
3131
load(
3232
"//contrib/endpoints:repositories.bzl",
3333
"grpc_repositories",
34-
"mixerapi_repositories",
34+
"mixer_client_repositories",
3535
"servicecontrol_client_repositories",
3636
)
3737

3838
grpc_repositories()
3939

40-
mixerapi_repositories()
40+
mixer_client_repositories()
4141

4242
servicecontrol_client_repositories()
4343

44+
# Workaround for Bazel > 0.4.0 since it needs newer protobuf.bzl from:
45+
# https://github.com/google/protobuf/pull/2246
46+
# Do not use this git_repository for anything else than protobuf.bzl
47+
new_git_repository(
48+
name = "protobuf_bzl",
49+
# Injecting an empty BUILD file to prevent using any build target
50+
build_file_content = "",
51+
commit = "05090726144b6e632c50f47720ff51049bfcbef6",
52+
remote = "https://github.com/google/protobuf.git",
53+
)
54+
55+
load(
56+
"@mixerclient_git//:repositories.bzl",
57+
"mixerapi_repositories",
58+
)
59+
60+
mixerapi_repositories(protobuf_repo="@protobuf_bzl//")
61+
4462
load(
4563
"//src/envoy:repositories.bzl",
4664
"envoy_repositories",

contrib/endpoints/repositories.bzl

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -334,51 +334,15 @@ def servicecontrol_client_repositories(bind=True):
334334
actual = "@servicecontrol_client_git//:service_control_client_lib",
335335
)
336336

337-
def mixerapi_repositories(protobuf_repo="@protobuf_git//", bind=True):
338-
BUILD = """
339-
# Copyright 2016 Google Inc. All Rights Reserved.
340-
#
341-
# Licensed under the Apache License, Version 2.0 (the "License");
342-
# you may not use this file except in compliance with the License.
343-
# You may obtain a copy of the License at
344-
#
345-
# http://www.apache.org/licenses/LICENSE-2.0
346-
#
347-
# Unless required by applicable law or agreed to in writing, software
348-
# distributed under the License is distributed on an "AS IS" BASIS,
349-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
350-
# See the License for the specific language governing permissions and
351-
# limitations under the License.
352-
#
353-
################################################################################
354-
#
355-
licenses(["notice"])
356-
357-
load("{}:protobuf.bzl", "cc_proto_library")
358-
359-
cc_proto_library(
360-
name = "mixer_api_cc_proto",
361-
srcs = glob(
362-
["mixer/api/v1/*.proto"],
363-
),
364-
default_runtime = "//external:protobuf",
365-
protoc = "//external:protoc",
366-
visibility = ["//visibility:public"],
367-
deps = [
368-
"//external:cc_wkt_protos",
369-
"//external:servicecontrol",
370-
],
371-
)
372-
""".format(protobuf_repo)
373-
374-
native.new_git_repository(
375-
name = "mixerapi_git",
376-
commit = "fc5a396185edc72d06d1937f30a8148a37d4fc1b",
377-
remote = "https://github.com/istio/api.git",
378-
build_file_content = BUILD,
337+
def mixer_client_repositories(bind=True):
338+
native.git_repository(
339+
name = "mixerclient_git",
340+
commit = "1569430f1e27b31e23c029c6bec0d8d5062d9e55",
341+
remote = "https://github.com/istio/mixerclient.git",
379342
)
343+
380344
if bind:
381345
native.bind(
382-
name = "mixer_api_cc_proto",
383-
actual = "@mixerapi_git//:mixer_api_cc_proto",
346+
name = "mixer_client_lib",
347+
actual = "@mixerclient_git//:mixer_client_lib",
384348
)

contrib/endpoints/src/api_manager/mixer/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ cc_library(
3232
],
3333
}),
3434
deps = [
35-
"//external:grpc++",
36-
"//external:mixer_api_cc_proto",
37-
"//external:protobuf",
3835
"//contrib/endpoints/src/api_manager:impl_headers",
3936
"//contrib/endpoints/src/api_manager/service_control",
4037
"//contrib/endpoints/src/api_manager/utils",
38+
"//external:grpc++",
39+
"//external:mixer_client_lib",
40+
"//external:protobuf",
4141
],
4242
)

0 commit comments

Comments
 (0)