Skip to content

Commit

Permalink
Add java_plugin_info.bzl for Starlark JavaPluginInfo
Browse files Browse the repository at this point in the history
Update all references in builtins to the symbol exported in this file.

PiperOrigin-RevId: 538479229
Change-Id: If4dc4eb4cb6943632c1b7e5908fe9ed61679bc09
  • Loading branch information
hvadehra authored and copybara-github committed Jun 7, 2023
1 parent 2fe450f commit 4d18a35
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/main/starlark/builtins_bzl/common/java/compile_action.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ load(":common/java/java_semantics.bzl", "semantics")

java_common = _builtins.toplevel.java_common

JavaPluginInfo = _builtins.toplevel.JavaPluginInfo

def _filter_strict_deps(mode):
return "error" if mode in ["strict", "default"] else mode

Expand Down
2 changes: 1 addition & 1 deletion src/main/starlark/builtins_bzl/common/java/java_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ load(":common/proto/proto_info.bzl", "ProtoInfo")
load(":common/cc/cc_info.bzl", "CcInfo")
load(":common/paths.bzl", "paths")
load(":common/java/java_info.bzl", "JavaInfo")
load(":common/java/java_plugin_info.bzl", "JavaPluginInfo")

CcLauncherInfo = _builtins.internal.cc_internal.launcher_provider
JavaPluginInfo = _builtins.toplevel.JavaPluginInfo
java_common = _builtins.toplevel.java_common

InternalDeployJarInfo = provider(
Expand Down
3 changes: 1 addition & 2 deletions src/main/starlark/builtins_bzl/common/java/java_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ load(":common/java/java_semantics.bzl", "semantics")
load(":common/java/proguard_validation.bzl", "validate_proguard_specs")
load(":common/cc/cc_info.bzl", "CcInfo")
load(":common/java/java_info.bzl", "JavaInfo")
load(":common/java/java_plugin_info.bzl", "JavaPluginInfo")

java_common = _builtins.toplevel.java_common
coverage_common = _builtins.toplevel.coverage_common

JavaPluginInfo = _builtins.toplevel.JavaPluginInfo

def _filter_srcs(srcs, ext):
return [f for f in srcs if f.extension == ext]

Expand Down
3 changes: 1 addition & 2 deletions src/main/starlark/builtins_bzl/common/java/java_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ load(":common/rule_util.bzl", "merge_attrs")
load(":common/java/java_semantics.bzl", "semantics")
load(":common/cc/cc_info.bzl", "CcInfo")
load(":common/java/java_info.bzl", "JavaInfo")

JavaPluginInfo = _builtins.toplevel.JavaPluginInfo
load(":common/java/java_plugin_info.bzl", "JavaPluginInfo")

def bazel_java_library_rule(
ctx,
Expand Down
3 changes: 1 addition & 2 deletions src/main/starlark/builtins_bzl/common/java/java_plugin.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ load(":common/java/java_common.bzl", "basic_java_library", "construct_defaultinf
load(":common/java/java_library.bzl", "JAVA_LIBRARY_ATTRS", "JAVA_LIBRARY_IMPLICIT_ATTRS")
load(":common/rule_util.bzl", "merge_attrs")
load(":common/java/java_semantics.bzl", "semantics")

JavaPluginInfo = _builtins.toplevel.JavaPluginInfo
load(":common/java/java_plugin_info.bzl", "JavaPluginInfo")

def bazel_java_plugin_rule(
ctx,
Expand Down
19 changes: 19 additions & 0 deletions src/main/starlark/builtins_bzl/common/java/java_plugin_info.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 The Bazel Authors. 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.

"""
Definition of JavaPluginInfo provider.
"""

JavaPluginInfo = _builtins.toplevel.JavaPluginInfo
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Java Semantics
load(":common/java/java_info.bzl", "JavaInfo")

java_common = _builtins.toplevel.java_common
JavaPluginInfo = _builtins.toplevel.JavaPluginInfo

def _postprocess(ctx, base_info):
return base_info.java_info
Expand Down

0 comments on commit 4d18a35

Please sign in to comment.