load("@io_bazel_rules_go//go:def.bzl", "go_repositories", "new_go_repository")

# rpc_repositories expects to already have java_base_repositories loaded.
def rpc_repositories():
  native.git_repository(
    name = "protobuf",
    # v3.1.0 with changes to compile javanano too.
    commit = "5f28c0a22e511eb4daff9ba609a137920785c806",
    remote = "https://github.com/simonhorlick/protobuf.git",
  )

  native.git_repository(
    name = "grpc",
    commit = "11ae5a77d6b2a059ef3fe4742ff2cc8b03b17139",
    remote = "https://github.com/grpc/grpc.git",
  )

  native.new_git_repository(
    name = "grpc_java",
    remote = "https://github.com/grpc/grpc-java.git",
    commit = "ea4390cf5c44e066e1649418f69822029bb58f1e",
    build_file = str(Label("//third_party:grpc-java.BUILD")),
  )

  native.maven_jar(
    name = "com_google_instrumentation_instrumentation_api",
    artifact = "com.google.instrumentation:instrumentation-api:0.3.0",
    sha1 = "a2e145e7a7567c6372738f5c5a6f3ba6407ac354",
  )

  # For exporting metrics from grpc.
  native.git_repository(
    name = "me_dinowernli_java_grpc_prometheus",
    remote = "https://github.com/simonhorlick/java-grpc-prometheus.git",
    commit = "2bdb22e4d415b81fd976a9dbb86dfe72e5b3da7f",
  )

  # For me_dinowernli_java_grpc_prometheus
  native.bind(
      name = "grpc_core",
      actual = "@grpc_java//:core",
  )
  native.bind(
      name = "grpc_stub",
      actual = "@grpc_java//:stub",
  )
  native.bind(
      name = "prometheus_client",
      actual = "@io_prometheus_simpleclient//jar",
  )

  native.maven_jar(
    name = "io_prometheus_simpleclient",
    artifact = "io.prometheus:simpleclient:0.0.19",
    sha1 = "c1424b444a7ec61e056a180d52470ff397bc428d",
  )

  native.maven_jar(
    name = "io_prometheus_simpleclient_common",
    artifact = "io.prometheus:simpleclient_common:0.0.19",
    sha1 = "aa0d4a87c02e71924c913fbb4629b7ca5966a5ff",
  )

  native.maven_jar(
    name = "io_netty_netty_all",
    artifact = "io.netty:netty-all:4.1.6.Final",
    sha1 = "6cb4393b29248778f0bcf89118c949304cec8bb8",
  )

  native.maven_jar(
    name = "okhttp",
    artifact = "com.squareup.okhttp:okhttp:2.7.4",
    sha1 = "f2c0782541a970b3c15f5e742999ca264b34d0bd",
  )

  native.maven_jar(
    name = "okio",
    artifact = "com.squareup.okio:okio:1.6.0",
    sha1 = "98476622f10715998eacf9240d6b479f12c66143",
  )

  new_go_repository(
    name = "com_github_grpc_ecosystem_grpc_gateway",
    importpath = "github.com/grpc-ecosystem/grpc-gateway",
    commit = "372984b6925646ccd2e7987037106b4337def2a9",
  )

  new_go_repository(
    name = "com_github_golang_glog",
    commit = "23def4e6c14b4da8ac2ed8007337bc5eb5007998",
    importpath = "github.com/golang/glog",
  )

  new_go_repository(
    name = "com_github_golang_protobuf",
    importpath = "github.com/golang/protobuf",
    commit = "1f49d83d9aa00e6ce4fc8258c71cc7786aec968a",
  )

  new_go_repository(
    name = "org_golang_x_net",
    commit = "de35ec43e7a9aabd6a9c54d2898220ea7e44de7d",
    importpath = "golang.org/x/net",
  )

  new_go_repository(
    name = "org_golang_google_grpc",
    tag = "v1.0.1-GA",
    importpath = "google.golang.org/grpc",
  )

@@ -2518,48 +2518,48 @@
  = %22
-372984b6925646ccd2e7987037106b4337def2a9
+686368427ddb9a51628d63db6c74fbc96a206e1f
 %22,%0A 
@@ -2852,48 +2852,48 @@
  = %22
-1f49d83d9aa00e6ce4fc8258c71cc7786aec968a
+8ee79997227bf9b34611aee7946ae64735e6fd93
 %22,%0A 
@@ -3101,24 +3101,149 @@
 ogle_grpc%22,%0A
+    # Note that this needs to be kept in line with com_github_golang_protobuf so the%0A    # generated sources are compatible.%0A
     tag = %22v
@@ -3250,12 +3250,9 @@
 1.0.
-1-GA
+4
 %22,%0A 
@@ -3293,12 +3293,146 @@
 /grpc%22,%0A  )%0A
+%0A  new_go_repository(%0A    name = %22com_github_gorilla_handlers%22,%0A    tag = %22v1.2%22,%0A    importpath = %22github.com/gorilla/handlers%22,%0A  )%0A

Update grpc-gateway