From 699f87aee01c8ae55b29c0a8ff76527795d2d14d Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Thu, 18 Feb 2016 23:48:32 +0000 Subject: [PATCH] Rename proto_java_library to java_proto_library. RELNOTES[INC]: Renamed proto_java_library to java_proto_library. The former is now deprecated and will print out a warning when used. -- MOS_MIGRATED_REVID=115012027 --- examples/proto/BUILD | 6 +++--- src/main/protobuf/BUILD | 6 +++--- tools/build_rules/genproto.bzl | 7 ++++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/proto/BUILD b/examples/proto/BUILD index def85a789fb975..0d3108176e64f4 100644 --- a/examples/proto/BUILD +++ b/examples/proto/BUILD @@ -1,14 +1,14 @@ package(default_visibility = ["//visibility:public"]) -load("//tools/build_rules:genproto.bzl", "proto_java_library") +load("//tools/build_rules:genproto.bzl", "java_proto_library") proto_library( name = "proto_smoke_test", srcs = ["test.proto"], ) -# proto_java_library is a quick and dirty rule to help Bazel compile itself. -proto_java_library( +# java_proto_library is a quick and dirty rule to help Bazel compile itself. +java_proto_library( name = "test_proto", src = "test.proto", ) diff --git a/src/main/protobuf/BUILD b/src/main/protobuf/BUILD index 49546fed83706d..2255a2781628bc 100644 --- a/src/main/protobuf/BUILD +++ b/src/main/protobuf/BUILD @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools/build_rules:genproto.bzl", "proto_java_library") +load("//tools/build_rules:genproto.bzl", "java_proto_library") FILES = [ "build", @@ -20,12 +20,12 @@ FILES = [ "remote_protocol", ] -[proto_java_library( +[java_proto_library( name = s + "_proto", src = s + ".proto", ) for s in FILES] -proto_java_library( +java_proto_library( name = "build_proto_v2", src = "build.proto", ) diff --git a/tools/build_rules/genproto.bzl b/tools/build_rules/genproto.bzl index 47715df4992d4a..2a59791a2ad3b8 100644 --- a/tools/build_rules/genproto.bzl +++ b/tools/build_rules/genproto.bzl @@ -65,7 +65,7 @@ gensrcjar = rule( ) # TODO(bazel-team): support proto => proto dependencies too -def proto_java_library(name, src): +def java_proto_library(name, src): gensrcjar(name=name + "_srcjar", src=src) native.java_library( name=name, @@ -74,3 +74,8 @@ def proto_java_library(name, src): # The generated code has lots of 'rawtypes' warnings. javacopts=["-Xlint:-rawtypes"], ) + +def proto_java_library(name, src): + print("Deprecated: use java_proto_library() instead, proto_java_library " + + "will be removed in version 0.2.1") + java_proto_library(name, src)