diff options
Diffstat (limited to 'kotlin/jvm/internal_do_not_use')
4 files changed, 15 insertions, 92 deletions
diff --git a/kotlin/jvm/internal_do_not_use/traverse_exports/BUILD b/kotlin/jvm/internal_do_not_use/traverse_exports/BUILD index 0f39dbe..9b5382c 100644 --- a/kotlin/jvm/internal_do_not_use/traverse_exports/BUILD +++ b/kotlin/jvm/internal_do_not_use/traverse_exports/BUILD @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("//bazel:stubs.bzl", "integration_test_filegroup") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( @@ -30,3 +31,11 @@ bzl_library( "@bazel_skylib//lib:sets", ], ) + +integration_test_filegroup( + name = "bazel_osx_p4deps", + deps = [ + ":traverse_exports_bzl", + "//kotlin/common:bazel_osx_p4deps", + ], +) diff --git a/kotlin/jvm/internal_do_not_use/traverse_exports/codegen_plugin.bzl b/kotlin/jvm/internal_do_not_use/traverse_exports/codegen_plugin.bzl deleted file mode 100644 index 84a0960..0000000 --- a/kotlin/jvm/internal_do_not_use/traverse_exports/codegen_plugin.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2022 Google LLC. 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. - -"""kt_codegen_plugin_visitor""" - -load("//kotlin:codegen_plugin.internal.bzl", "KtCodegenPluginInfo") -load("//:visibility.bzl", "RULES_KOTLIN") - -def _get_kt_codegen_plugins(_target, ctx_rule): - return [ - t[KtCodegenPluginInfo] - for t in getattr(ctx_rule.attr, "exported_plugins", []) - if KtCodegenPluginInfo in t - ] - -kt_codegen_plugin_visitor = struct( - name = "codegen_plugins", - visit_target = _get_kt_codegen_plugins, - filter_edge = None, - finish_expansion = None, - process_unvisited_target = None, -) diff --git a/kotlin/jvm/internal_do_not_use/util/BUILD b/kotlin/jvm/internal_do_not_use/util/BUILD index 7e82771..157c675 100644 --- a/kotlin/jvm/internal_do_not_use/util/BUILD +++ b/kotlin/jvm/internal_do_not_use/util/BUILD @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("//bazel:stubs.bzl", "integration_test_filegroup") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( @@ -29,3 +30,8 @@ bzl_library( "@bazel_tools//tools/jdk:jvmopts", ], ) + +integration_test_filegroup( + name = "bazel_osx_p4deps", + deps = [":util_bzl"], +) diff --git a/kotlin/jvm/internal_do_not_use/util/class_file_selectors.bzl b/kotlin/jvm/internal_do_not_use/util/class_file_selectors.bzl deleted file mode 100644 index d3647d3..0000000 --- a/kotlin/jvm/internal_do_not_use/util/class_file_selectors.bzl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2022 Google LLC. 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. - -"""Selects bytecode class files with a matched source file in srcjars.""" - -load("//:visibility.bzl", "RULES_KOTLIN") -load("//toolchains/kotlin_jvm:kt_jvm_toolchains.bzl", "kt_jvm_toolchains") - -def gen_java_info_generated_class_jar(ctx, file_factory, kt_toolchain, input_jars, srcjars): - """Generates a class jar with class file jar entries matching files in the give srcjars. - - Args: - ctx: A rule context. - file_factory: A file factory in responsible for file creation under the current context. - kt_toolchain: The toolchain for kotlin builds. - input_jars: A sequence of jar files from which class files are selected. - srcjars: A sequence of source jar files that the selection references to. - Returns: - The output jar file, i.e. output_jar. - """ - output_jar = file_factory.declare_file("-java_info_generated_class_jar.jar") - input_jars = depset(input_jars) - transformer_env_files = depset(srcjars) - - transformer_entry_point = "com.google.devtools.jar.transformation.ClassFileSelectorBySourceFile" - transformer_jars = kt_toolchain.class_file_selector_by_source_file[JavaInfo].transitive_runtime_jars - jar_transformer = kt_toolchain.jar_transformer[DefaultInfo].files_to_run - - args = ctx.actions.args() - args.add_joined("--input_jars", input_jars, join_with = ",") - args.add_joined("--transformer_jars", transformer_jars, join_with = ",") - args.add("--transformer_entry_point", transformer_entry_point) - args.add_joined("--transformer_env_files", transformer_env_files, join_with = ",") - args.add("--result", output_jar) - ctx.actions.run( - inputs = depset(transitive = [ - input_jars, - transformer_jars, - transformer_env_files, - ]), - outputs = [output_jar], - arguments = [args], - progress_message = "Generating JavaInfo.generated_class_jar into %{output}", - mnemonic = "ClassFileSelectorBySourceFile", - executable = jar_transformer, - toolchain = kt_jvm_toolchains.type, - ) - return output_jar |