diff --git a/BUILD b/BUILD index 32ee639a4..80e6873aa 100644 --- a/BUILD +++ b/BUILD @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. load("//src/main/starlark/release:packager.bzl", "release_archive") -load("//src/main/starlark/core/repositories:versions.bzl", "versions") load("//kotlin:lint.bzl", "ktlint_config") exports_files([ @@ -52,20 +51,9 @@ test_suite( ], ) -[ - release_archive( - name = version, - deps = [ - "@%s//:pkg" % version, - ], - ) - for version in versions.CORE -] - # Release target. release_archive( name = "rules_kotlin_release", - srcs = ["%s.tgz" % v for v in versions.CORE], src_map = { "BUILD.release.bazel": "BUILD.bazel", "WORKSPACE.release.bazel": "WORKSPACE", diff --git a/kotlin/internal/BUILD b/kotlin/internal/BUILD index 8e8cf852d..b98b89da9 100644 --- a/kotlin/internal/BUILD +++ b/kotlin/internal/BUILD @@ -13,7 +13,6 @@ # limitations under the License. load("//kotlin/internal:toolchains.bzl", "kt_configure_toolchains") load("//src/main/starlark/release:packager.bzl", "release_archive") -load("//src/main/starlark/core/repositories:versions.bzl", "versions") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") # Configures the toolchains @@ -23,11 +22,9 @@ release_archive( name = "pkg", srcs = glob( ["*.bzl"], - exclude = ["opts.bzl"], ), src_map = { "BUILD.release.bazel": "BUILD.bazel", - "opts.release.bzl": "opts.bzl", }, deps = [ "//kotlin/internal/js:pkg", @@ -47,8 +44,5 @@ bzl_library( "//kotlin/internal/lint", "//kotlin/internal/utils", "//src/main/starlark", - ] + [ - "@%s//starlark" % v - for v in versions.CORE ], ) diff --git a/kotlin/internal/opts.bzl b/kotlin/internal/opts.bzl index 7480558e4..e9361d9cf 100644 --- a/kotlin/internal/opts.bzl +++ b/kotlin/internal/opts.bzl @@ -13,13 +13,13 @@ # limitations under the License. load( - "@rkt_1_8//starlark/kotlin:opts.bzl", + "//src/main/starlark/core/options:opts.kotlinc.bzl", _KotlincOptions = "KotlincOptions", _kotlinc_options_to_flags = "kotlinc_options_to_flags", _kt_kotlinc_options = "kt_kotlinc_options", ) load( - "@rkt_1_8//starlark/jvm:opts.bzl", + "//src/main/starlark/core/options:opts.javac.bzl", _JavacOptions = "JavacOptions", _javac_options_to_flags = "javac_options_to_flags", _kt_javac_options = "kt_javac_options", diff --git a/src/legacy/BUILD.bazel b/src/legacy/BUILD.bazel deleted file mode 100644 index 16a80bc46..000000000 --- a/src/legacy/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") - -release_archive( - name = "pkg", - srcs = ["WORKSPACE"], - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, - deps = [ - "//starlark/jvm:pkg", - "//starlark/kotlin:pkg", - ], -) diff --git a/src/legacy/BUILD.release.bazel b/src/legacy/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/legacy/WORKSPACE b/src/legacy/WORKSPACE deleted file mode 100644 index da8558c0d..000000000 --- a/src/legacy/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -workspace(name = "legacy") diff --git a/src/legacy/starlark/BUILD.bazel b/src/legacy/starlark/BUILD.bazel deleted file mode 100644 index fa415960a..000000000 --- a/src/legacy/starlark/BUILD.bazel +++ /dev/null @@ -1,10 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "starlark", - visibility = ["//visibility:public"], - deps = [ - "//starlark/jvm", - "//starlark/kotlin", - ], -) diff --git a/src/legacy/starlark/jvm/BUILD.bazel b/src/legacy/starlark/jvm/BUILD.bazel deleted file mode 100644 index ca9e0bfa0..000000000 --- a/src/legacy/starlark/jvm/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "jvm", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], - deps = [ - "@dev_io_bazel_rules_kotlin//src/main/starlark", - ], -) diff --git a/src/legacy/starlark/jvm/BUILD.release.bazel b/src/legacy/starlark/jvm/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/legacy/starlark/jvm/opts.bzl b/src/legacy/starlark/jvm/opts.bzl deleted file mode 100644 index e56e98925..000000000 --- a/src/legacy/starlark/jvm/opts.bzl +++ /dev/null @@ -1,82 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:derive.bzl", "derive") -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -_JOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "error": ["-Werror"], - "report": None, - }, - ), - "x_ep_disable_all_checks": struct( - args = dict( - default = False, - doc = "See javac -XepDisableAllChecks documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XepDisableAllChecks"], - }, - ), - "x_lint": struct( - args = dict( - default = [], - doc = "See javac -Xlint: documentation", - ), - type = attr.string_list, - value_to_flag = { - derive.info: derive.repeated_values_for("-Xlint:"), - }, - ), - "xd_suppress_notes": struct( - args = dict( - default = False, - doc = "See javac -XDsuppressNotes documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XDsuppressNotes"], - }, - ), -} - -def _javac_options_impl(ctx): - return struct( - providers = [ - JavacOptions(**{n: getattr(ctx.attr, n, None) for n in _JOPTS}), - ], - ) - -JavacOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _JOPTS.items() - }, -) - -kt_javac_options = rule( - implementation = _javac_options_impl, - doc = "Define java compiler options for `kt_jvm_*` rules with java sources.", - provides = [JavacOptions], - attrs = {n: o.type(**o.args) for n, o in _JOPTS.items()}, -) - -def javac_options_to_flags(javac_options): - """Translate JavacOptions to worker flags - - Args: - javac_options of type JavacOptions or None - Returns: - list of flags to add to the command line. - """ - if not javac_options: - return "" - - return convert.javac_options_to_flags(_JOPTS, javac_options) diff --git a/src/legacy/starlark/kotlin/BUILD.bazel b/src/legacy/starlark/kotlin/BUILD.bazel deleted file mode 100644 index d3174c345..000000000 --- a/src/legacy/starlark/kotlin/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "kotlin", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], -) diff --git a/src/legacy/starlark/kotlin/BUILD.release.bazel b/src/legacy/starlark/kotlin/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/legacy/starlark/kotlin/opts.bzl b/src/legacy/starlark/kotlin/opts.bzl deleted file mode 100644 index b639b9c62..000000000 --- a/src/legacy/starlark/kotlin/opts.bzl +++ /dev/null @@ -1,165 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -def _map_jvm_target_to_flag(version): - if not version: - return None - return ["-jvm-target=%s" % version] - -_KOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "report": None, - "error": ["-Werror"], - }, - ), - "include_stdlibs": struct( - args = dict( - default = "all", - doc = "Don't automatically include the Kotlin standard libraries into the classpath (stdlib and reflect).", - values = ["all", "stdlib", "none"], - ), - type = attr.string, - value_to_flag = { - "all": None, - "stdlib": ["-no-reflect"], - "none": ["-no-stdlib"], - }, - ), - "x_skip_prerelease_check": struct( - args = dict( - default = False, - doc = "Suppress errors thrown when using pre-release classes.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xskip-prerelease-check"], - }, - ), - "x_inline_classes": struct( - args = dict( - default = False, - doc = "Enable experimental inline classes", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xinline-classes"], - }, - ), - "x_allow_result_return_type": struct( - args = dict( - default = False, - doc = "Enable kotlin.Result as a return type", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xallow-result-return-type"], - }, - ), - "x_jvm_default": struct( - args = dict( - default = "off", - doc = "Specifies that a JVM default method should be generated for non-abstract Kotlin interface member.", - values = ["off", "enable", "disable", "compatibility", "all-compatibility", "all"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "enable": ["-Xjvm-default=enable"], - "disable": ["-Xjvm-default=disable"], - "compatibility": ["-Xjvm-default=compatibility"], - "all-compatibility": ["-Xjvm-default=all-compatibility"], - "all": ["-Xjvm-default=all"], - }, - ), - "x_no_optimized_callable_references": struct( - args = dict( - default = False, - doc = "Do not use optimized callable reference superclasses. Available from 1.4.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimized-callable-reference"], - }, - ), - "java_parameters": struct( - args = dict( - default = False, - doc = "Generate metadata for Java 1.8+ reflection on method parameters.", - ), - type = attr.bool, - value_to_flag = { - True: ["-java-parameters"], - }, - ), - "x_multi_platform": struct( - args = dict( - default = False, - doc = "Enable experimental language support for multi-platform projects", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xmulti-platform"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), - "jvm_target": struct( - args = dict( - default = "", - doc = "The -jvm_target flag. This is only tested at 1.8.", - values = ["1.6", "1.8", "9", "10", "11", "12", "13", "15", "16", "17"], - ), - type = attr.string, - value_to_flag = None, - map_value_to_flag = _map_jvm_target_to_flag, - ), -} - -KotlincOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _KOPTS.items() - }, -) - -def _kotlinc_options_impl(ctx): - return struct( - providers = [ - KotlincOptions(**{n: getattr(ctx.attr, n, None) for n in _KOPTS}), - ], - ) - -kt_kotlinc_options = rule( - implementation = _kotlinc_options_impl, - doc = "Define kotlin compiler options.", - provides = [KotlincOptions], - attrs = {n: o.type(**o.args) for n, o in _KOPTS.items()}, -) - -def kotlinc_options_to_flags(kotlinc_options): - """Translate KotlincOptions to worker flags - - Args: - kotlinc_options maybe containing KotlincOptions - Returns: - list of flags to add to the command line. - """ - return convert.kotlinc_options_to_flags(_KOPTS, kotlinc_options) diff --git a/src/main/starlark/core/options/BUILD.bazel b/src/main/starlark/core/options/BUILD.bazel index aae25093f..af636259a 100644 --- a/src/main/starlark/core/options/BUILD.bazel +++ b/src/main/starlark/core/options/BUILD.bazel @@ -15,4 +15,7 @@ bzl_library( name = "options", srcs = glob(["*.bzl"]), visibility = ["//:__subpackages__"], + deps = [ + "@com_github_jetbrains_kotlin//:capabilities", + ], ) diff --git a/src/rkt_1_8/starlark/jvm/opts.bzl b/src/main/starlark/core/options/opts.javac.bzl similarity index 76% rename from src/rkt_1_8/starlark/jvm/opts.bzl rename to src/main/starlark/core/options/opts.javac.bzl index a019afd6f..b388110d8 100644 --- a/src/rkt_1_8/starlark/jvm/opts.bzl +++ b/src/main/starlark/core/options/opts.javac.bzl @@ -1,5 +1,19 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:derive.bzl", "derive") -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") +# Copyright 2022 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. + +load("//src/main/starlark/core/options:derive.bzl", "derive") +load("//src/main/starlark/core/options:convert.bzl", "convert") _JOPTS = { "warn": struct( diff --git a/src/rkt_1_8/starlark/kotlin/opts.bzl b/src/main/starlark/core/options/opts.kotlinc.bzl similarity index 81% rename from src/rkt_1_8/starlark/kotlin/opts.bzl rename to src/main/starlark/core/options/opts.kotlinc.bzl index 932562ac5..6002d372e 100644 --- a/src/rkt_1_8/starlark/kotlin/opts.bzl +++ b/src/main/starlark/core/options/opts.kotlinc.bzl @@ -1,4 +1,19 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") +# Copyright 2022 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. + +load("//src/main/starlark/core/options:convert.bzl", "convert") +load("@com_github_jetbrains_kotlin//:capabilities.bzl", _KOTLIN_OPTS = "KOTLIN_OPTS") def _map_optin_class_to_flag(values): return ["-opt-in=%s" % v for v in values] @@ -13,7 +28,7 @@ def _map_jvm_target_to_flag(version): return None return ["-jvm-target=%s" % version] -_KOPTS = { +_KOPTS_ALL = { "warn": struct( args = dict( default = "report", @@ -41,6 +56,7 @@ _KOPTS = { }, ), "x_skip_prerelease_check": struct( + flag = "-Xskip-prerelease-check", args = dict( default = False, doc = "Suppress errors thrown when using pre-release classes.", @@ -51,6 +67,7 @@ _KOPTS = { }, ), "x_inline_classes": struct( + flag = "-Xinline-classes", args = dict( default = False, doc = "Enable experimental inline classes", @@ -61,6 +78,7 @@ _KOPTS = { }, ), "x_allow_result_return_type": struct( + flag = "-Xallow-result-return-type", args = dict( default = False, doc = "Enable kotlin.Result as a return type", @@ -71,6 +89,7 @@ _KOPTS = { }, ), "x_jvm_default": struct( + flag = "-Xjvm-default", args = dict( default = "off", doc = "Specifies that a JVM default method should be generated for non-abstract Kotlin interface member.", @@ -87,6 +106,7 @@ _KOPTS = { }, ), "x_no_call_assertions": struct( + flag = "-Xno-call-assertions", args = dict( default = False, doc = "Don't generate not-null assertions for arguments of platform types", @@ -97,6 +117,7 @@ _KOPTS = { }, ), "x_no_param_assertions": struct( + flag = "-Xno-param-assertions", args = dict( default = False, doc = "Don't generate not-null assertions on parameters of methods accessible from Java", @@ -107,6 +128,7 @@ _KOPTS = { }, ), "x_no_receiver_assertions": struct( + flag = "-Xno-receiver-assertions", args = dict( default = False, doc = "Don't generate not-null assertion for extension receiver arguments of platform types", @@ -117,16 +139,18 @@ _KOPTS = { }, ), "x_no_optimized_callable_references": struct( + flag = "-Xno-optimized-callable-references", args = dict( default = False, doc = "Do not use optimized callable reference superclasses. Available from 1.4.", ), type = attr.bool, value_to_flag = { - True: ["-Xno-optimized-callable-reference"], + True: ["-Xno-optimized-callable-references"], }, ), "x_explicit_api_mode": struct( + flag = "-Xexplicit-api", args = dict( default = "off", doc = "Enable explicit API mode for Kotlin libraries.", @@ -150,6 +174,7 @@ _KOPTS = { }, ), "x_multi_platform": struct( + flag = "-Xmulti-platform", args = dict( default = False, doc = "Enable experimental language support for multi-platform projects", @@ -160,6 +185,7 @@ _KOPTS = { }, ), "x_sam_conversions": struct( + flag = "-Xsam-conversions", args = dict( default = "class", doc = "Change codegen behavior of SAM/functional interfaces", @@ -172,6 +198,7 @@ _KOPTS = { }, ), "x_lambdas": struct( + flag = "-Xlambdas", args = dict( default = "class", doc = "Change codegen behavior of lambdas", @@ -184,6 +211,7 @@ _KOPTS = { }, ), "x_emit_jvm_type_annotations": struct( + flag = "-Xemit-jvm-type-annotations", args = dict( default = False, doc = "Basic support for type annotations in JVM bytecode.", @@ -202,7 +230,21 @@ _KOPTS = { value_to_flag = None, map_value_to_flag = _map_optin_class_to_flag, ), + "x_use_fir": struct( + # 1.6 + flag = "-Xuse-fir", + args = dict( + default = False, + doc = "Compile using the experimental Kotlin Front-end IR. Available from 1.6.", + ), + type = attr.bool, + value_to_flag = { + True: ["-Xuse-fir"], + }, + ), "x_use_k2": struct( + # 1.7 + flag = "-Xuse-k2", args = dict( default = False, doc = "Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided", @@ -213,6 +255,7 @@ _KOPTS = { }, ), "x_no_optimize": struct( + flag = "-Xno-optimize", args = dict( default = False, doc = "Disable optimizations", @@ -223,6 +266,8 @@ _KOPTS = { }, ), "x_backend_threads": struct( + # 1.6.20, 1.7 + flag = "-Xbackend-threads", args = dict( default = 1, doc = "When using the IR backend, run lowerings by file in N parallel threads. 0 means use a thread per processor core. Default value is 1.", @@ -232,6 +277,7 @@ _KOPTS = { map_value_to_flag = _map_backend_threads_to_flag, ), "x_report_perf": struct( + flag = "-Xreport-perf", args = dict( default = False, doc = "Report detailed performance statistics", @@ -251,18 +297,11 @@ _KOPTS = { value_to_flag = None, map_value_to_flag = _map_jvm_target_to_flag, ), - "x_debug": struct( - args = dict( - default = False, - doc = "Enable debugging, this option allows for a better debugging experience, especially when using coroutines, but should not be used in production", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xdebug"], - }, - ), } +# Filters out options that are not available in current compiler release +_KOPTS = {attr: defn for (attr, defn) in _KOPTS_ALL.items() if not hasattr(defn, "flag") or defn.flag in _KOTLIN_OPTS} + KotlincOptions = provider( fields = { name: o.args["doc"] diff --git a/src/main/starlark/core/repositories/BUILD b/src/main/starlark/core/repositories/BUILD index 507bff3da..d5a58b72f 100644 --- a/src/main/starlark/core/repositories/BUILD +++ b/src/main/starlark/core/repositories/BUILD @@ -18,9 +18,6 @@ release_archive( name = "pkg", srcs = [ "BUILD.com_github_google_ksp.bazel", - "BUILD.com_github_jetbrains_kotlin.bazel", - "compiler.bzl", - "configured_rules.bzl", "ksp.bzl", "versions.bzl", ], @@ -28,6 +25,9 @@ release_archive( "initialize.release.bzl": "initialize.bzl", "BUILD.release.bazel": "BUILD.bazel", }, + deps = [ + "//src/main/starlark/core/repositories/kotlin:pkg", + ], ) bzl_library( @@ -35,6 +35,7 @@ bzl_library( srcs = glob(["*.bzl"]), visibility = ["//:__subpackages__"], deps = [ + "//src/main/starlark/core/repositories/kotlin", "@rules_proto//proto", "@rules_proto//proto/private", ], diff --git a/src/main/starlark/core/repositories/compiler.bzl b/src/main/starlark/core/repositories/compiler.bzl deleted file mode 100644 index d11718118..000000000 --- a/src/main/starlark/core/repositories/compiler.bzl +++ /dev/null @@ -1,41 +0,0 @@ -def _kotlin_compiler_impl(repository_ctx): - """Creates the kotlinc repository.""" - attr = repository_ctx.attr - repository_ctx.download_and_extract( - attr.urls, - sha256 = attr.sha256, - stripPrefix = "kotlinc", - ) - repository_ctx.file( - "WORKSPACE", - content = """workspace(name = "%s")""" % attr.name, - ) - repository_ctx.template( - "BUILD.bazel", - attr._template, - substitutions = { - "{{.KotlinRulesRepository}}": attr.kotlin_rules, - }, - executable = False, - ) - -kotlin_compiler_repository = repository_rule( - implementation = _kotlin_compiler_impl, - attrs = { - "urls": attr.string_list( - doc = "A list of urls for the kotlin compiler", - mandatory = True, - ), - "kotlin_rules": attr.string( - doc = "target of the kotlin rules.", - mandatory = True, - ), - "sha256": attr.string( - doc = "sha256 of the compiler archive", - ), - "_template": attr.label( - doc = "repository build file template", - default = ":BUILD.com_github_jetbrains_kotlin.bazel", - ), - }, -) diff --git a/src/main/starlark/core/repositories/configured_rules.bzl b/src/main/starlark/core/repositories/configured_rules.bzl deleted file mode 100644 index 3a44540cf..000000000 --- a/src/main/starlark/core/repositories/configured_rules.bzl +++ /dev/null @@ -1,16 +0,0 @@ -def _rules_repository_impl(repository_ctx): - attr = repository_ctx.attr - repository_ctx.extract(attr.archive) - -rules_repository = repository_rule( - implementation = _rules_repository_impl, - attrs = { - "archive": attr.label( - doc = "label to repository archive", - allow_single_file = True, - ), - "parent": attr.label( - doc = "label to parent repository", - ), - }, -) diff --git a/src/main/starlark/core/repositories/initialize.bzl b/src/main/starlark/core/repositories/initialize.bzl index b5c9e926b..902d6004e 100644 --- a/src/main/starlark/core/repositories/initialize.bzl +++ b/src/main/starlark/core/repositories/initialize.bzl @@ -37,5 +37,5 @@ def kotlin_repositories( compiler_release: (internal) version provider from versions.bzl. ksp_compiler_release: (internal) version provider from versions.bzl. """ - _release_kotlin_repositories(compiler_release = compiler_release, ksp_compiler_release = ksp_compiler_release, configured_repository_name = None) + _release_kotlin_repositories(compiler_release = compiler_release, ksp_compiler_release = ksp_compiler_release) kt_configure() diff --git a/src/main/starlark/core/repositories/initialize.release.bzl b/src/main/starlark/core/repositories/initialize.release.bzl index 2264fdd11..dccdfb492 100644 --- a/src/main/starlark/core/repositories/initialize.release.bzl +++ b/src/main/starlark/core/repositories/initialize.release.bzl @@ -25,9 +25,8 @@ load( "http_file", ) load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load(":compiler.bzl", "kotlin_compiler_repository") +load("//src/main/starlark/core/repositories/kotlin:compiler.bzl", "kotlin_compiler_repository") load(":ksp.bzl", "ksp_compiler_plugin_repository") -load(":configured_rules.bzl", "rules_repository") load(":versions.bzl", "version", _versions = "versions") versions = _versions @@ -38,8 +37,7 @@ def kotlin_repositories( compiler_repository_name = _KT_COMPILER_REPO, ksp_repository_name = _KSP_COMPILER_PLUGIN_REPO, compiler_release = versions.KOTLIN_CURRENT_COMPILER_RELEASE, - ksp_compiler_release = versions.KSP_CURRENT_COMPILER_PLUGIN_RELEASE, - configured_repository_name = "io_bazel_rules_kotlin_configured"): + ksp_compiler_release = versions.KSP_CURRENT_COMPILER_PLUGIN_RELEASE): """Call this in the WORKSPACE file to setup the Kotlin rules. Args: @@ -55,6 +53,7 @@ def kotlin_repositories( urls = [url.format(version = compiler_release.version) for url in compiler_release.url_templates], sha256 = compiler_release.sha256, kotlin_rules = RULES_KOTLIN.workspace_name, + compiler_version = compiler_release.version, ) ksp_compiler_plugin_repository( @@ -104,21 +103,6 @@ def kotlin_repositories( sha256 = versions.SKYLIB_SHA, ) - selected_version = None - for (version, criteria) in versions.CORE.items(): - if (criteria and compiler_release.version.startswith(criteria.prefix)) or (not selected_version and not criteria): - selected_version = version - - if configured_repository_name: # without a repository name, no default kt_* rules repository is created. - rules_repository( - name = configured_repository_name, - archive = Label("//:%s.tgz" % selected_version), - parent = RULES_KOTLIN, - repo_mapping = { - "@dev_io_bazel_rules_kotlin": "@%s" % RULES_KOTLIN.workspace_name, - }, - ) - def kotlinc_version(release, sha256): return version( version = release, diff --git a/src/main/starlark/core/repositories/kotlin/BUILD b/src/main/starlark/core/repositories/kotlin/BUILD new file mode 100644 index 000000000..a104eced6 --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/BUILD @@ -0,0 +1,17 @@ +load("//src/main/starlark/release:packager.bzl", "release_archive") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +release_archive( + name = "pkg", + srcs = [ + "BUILD", + "BUILD.com_github_jetbrains_kotlin.bazel", + "compiler.bzl", + ] + glob(["capabilities_*.bazel"]), +) + +bzl_library( + name = "kotlin", + srcs = glob(["*.bzl"]), + visibility = ["//:__subpackages__"], +) diff --git a/src/main/starlark/core/repositories/BUILD.com_github_jetbrains_kotlin.bazel b/src/main/starlark/core/repositories/kotlin/BUILD.com_github_jetbrains_kotlin.bazel similarity index 94% rename from src/main/starlark/core/repositories/BUILD.com_github_jetbrains_kotlin.bazel rename to src/main/starlark/core/repositories/kotlin/BUILD.com_github_jetbrains_kotlin.bazel index 7efddcef7..c712aa43b 100644 --- a/src/main/starlark/core/repositories/BUILD.com_github_jetbrains_kotlin.bazel +++ b/src/main/starlark/core/repositories/kotlin/BUILD.com_github_jetbrains_kotlin.bazel @@ -15,16 +15,18 @@ load("@{{.KotlinRulesRepository}}//kotlin:jvm.bzl", "kt_jvm_import") load("@{{.KotlinRulesRepository}}//kotlin:js.bzl", "kt_js_import") load("@rules_java//java:defs.bzl", "java_import") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package(default_visibility = ["//visibility:public"]) +exports_files( + ["capabilities.bzl"], +) + # Kotlin home filegroup containing everything that is needed. filegroup( name = "home", - srcs = glob([ - "**", - "**/*.jar", - ]), + srcs = glob(["**"]), ) kt_jvm_import( @@ -136,3 +138,8 @@ kt_jvm_import( "stdlib-js", ] ] + +bzl_library( + name = "capabilities", + srcs = ["capabilities.bzl"], +) diff --git a/src/main/starlark/core/repositories/kotlin/capabilities_1.4.bzl.com_github_jetbrains_kotlin.bazel b/src/main/starlark/core/repositories/kotlin/capabilities_1.4.bzl.com_github_jetbrains_kotlin.bazel new file mode 100644 index 000000000..a75ed690b --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/capabilities_1.4.bzl.com_github_jetbrains_kotlin.bazel @@ -0,0 +1,125 @@ +# Copyright 2022 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. + +KOTLIN_OPTS = [ + "-Xadd-modules", + "-Xallow-jvm-ir-dependencies", + "-Xallow-kotlin-package", + "-Xallow-no-source-files", + "-Xallow-result-return-type", + "-Xassertions", + "-Xbuild-file", + "-Xcheck-phase-conditions", + "-Xcheck-sticky-phase-conditions", + "-Xcommon-sources", + "-Xcompile-java", + "-Xcoroutines", + "-Xdeserialize-fake-overrides", + "-Xdev-mode-overwriting-strategy", + "-Xdisable-default-scripting-plugin", + "-Xdisable-fake-override-validator", + "-Xdisable-phases", + "-Xdisable-standard-script", + "-Xdump-declarations-to", + "-Xdump-directory", + "-Xdump-fqname", + "-Xdump-perf", + "-Xeffect-system", + "-Xemit-jvm-type-annotations", + "-Xenable-js-scripting", + "-Xexclude-from-dumping", + "-Xexpect-actual-linker", + "-Xexperimental", + "-Xexplicit-api", + "-Xfriend-modules", + "-Xfriend-modules-disabled", + "-Xfriend-paths", + "-Xfriend-paths", + "-Xgenerate-dts", + "-Xgenerate-strict-metadata-version", + "-Xinclude", + "-Xinline-classes", + "-Xintellij-plugin-root", + "-Xir-binary-with-stable-abi", + "-Xir-check-local-names", + "-Xir-dce", + "-Xir-dce-driven", + "-Xir-dce-print-reachability-info", + "-Xir-module-name", + "-Xir-only", + "-Xir-produce-js", + "-Xir-produce-klib-dir", + "-Xir-produce-klib-file", + "-Xjava-package-prefix", + "-Xjava-source-roots", + "-Xjavac-arguments", + "-Xjps", + "-Xjsr305", + "-Xjvm-default", + "-Xklib", + "-Xlegacy-smart-cast-after-try", + "-Xlist-phases", + "-Xmetadata-only", + "-Xmetadata-version", + "-Xmodule-path", + "-Xmulti-platform", + "-Xmultifile-parts-inherit", + "-Xnew-inference", + "-Xno-call-assertions", + "-Xno-check-actual", + "-Xno-exception-on-explicit-equals-for-boxed-null", + "-Xno-inline", + "-Xno-kotlin-nothing-value-exception", + "-Xno-optimize", + "-Xno-optimized-callable-references", + "-Xno-param-assertions", + "-Xno-receiver-assertions", + "-Xno-unified-null-checks", + "-Xno-use-ir", + "-Xnormalize-constructor-calls", + "-Xopt-in", + "-Xphases-to-dump", + "-Xphases-to-dump-after", + "-Xphases-to-dump-before", + "-Xphases-to-validate", + "-Xphases-to-validate-after", + "-Xphases-to-validate-before", + "-Xplugin", + "-Xpolymorphic-signature", + "-Xprint-reachability-info", + "-Xprofile-phases", + "-Xproper-ieee754-comparisons", + "-Xread-deserialized-contracts", + "-Xrefines-paths", + "-Xreport-output-files", + "-Xreport-perf", + "-Xsanitize-parentheses", + "-Xscript-resolver-environment", + "-Xsingle-module", + "-Xskip-metadata-version-check", + "-Xskip-prerelease-check", + "-Xskip-runtime-version-check", + "-Xstrict-java-nullability-assertions", + "-Xsupport-compatqual-checker-framework-annotations", + "-Xsuppress-missing-builtins-error", + "-Xtyped-arrays", + "-Xuse-experimental", + "-Xuse-fir", + "-Xuse-ir", + "-Xuse-javac", + "-Xuse-mixed-named-arguments", + "-Xuse-old-class-files-reading", + "-Xuse-type-table", + "-Xverbose-phases", +] diff --git a/src/main/starlark/core/repositories/kotlin/capabilities_1.5.bzl.com_github_jetbrains_kotlin.bazel b/src/main/starlark/core/repositories/kotlin/capabilities_1.5.bzl.com_github_jetbrains_kotlin.bazel new file mode 100644 index 000000000..d64d841c2 --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/capabilities_1.5.bzl.com_github_jetbrains_kotlin.bazel @@ -0,0 +1,120 @@ +# Copyright 2022 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. + +KOTLIN_OPTS = [ + "-Xabi-stability", + "-Xadd-modules", + "-Xallow-no-source-files", + "-Xallow-unstable-dependencies", + "-Xassertions", + "-Xbuild-file", + "-Xcompile-java", + "-Xnormalize-constructor-calls", + "-Xdump-declarations-to", + "-Xdefault-script-extension", + "-Xdisable-standard-script", + "-Xir-do-not-clear-binding-context", + "-Xemit-jvm-type-annotations", + "-Xjvm-enable-preview", + "-Xfriend-paths", + "-Xmultifile-parts-inherit", + "-Xmodule-path", + "-Xjava-package-prefix", + "-Xjava-source-roots", + "-Xjavac-arguments", + "-Xjspecify-annotations", + "-Xjsr305", + "-Xjvm-default", + "-Xklib", + "-Xlambdas", + "-Xno-call-assertions", + "-Xno-exception-on-explicit-equals-for-boxed-null", + "-Xno-kotlin-nothing-value-exception", + "-Xno-optimize", + "-Xno-optimized-callable-references", + "-Xno-param-assertions", + "-Xno-receiver-assertions", + "-Xno-reset-jar-timestamps", + "-Xno-unified-null-checks", + "-Xprofile", + "-Xrepeat", + "-Xsam-conversions", + "-Xsanitize-parentheses", + "-Xscript-resolver-environment", + "-Xsingle-module", + "-Xskip-runtime-version-check", + "-Xstrict-java-nullability-assertions", + "-Xgenerate-strict-metadata-version", + "-Xstring-concat", + "-Xsupport-compatqual-checker-framework-annotations", + "-Xsuppress-deprecated-jvm-target-warning", + "-Xsuppress-missing-builtins-error", + "-Xtype-enhancement-improvements-strict-mode", + "-Xuse-ir", + "-Xuse-javac", + "-Xuse-old-backend", + "-Xuse-old-class-files-reading", + "-Xuse-14-inline-classes-mangling-scheme", + "-Xuse-old-spilled-var-type-analysis", + "-Xuse-type-table", + "-Xallow-kotlin-package", + "-Xallow-result-return-type", + "-Xcheck-phase-conditions", + "-Xcheck-sticky-phase-conditions", + "-Xcommon-sources", + "-Xdisable-default-scripting-plugin", + "-Xdisable-phases", + "-Xdisable-ultra-light-classes", + "-Xdump-directory", + "-Xdump-fqname", + "-Xdump-perf", + "-Xeffect-system", + "-Xexpect-actual-linker", + "-Xexperimental", + "-Xexplicit-api", + "-Xextended-compiler-checks", + "-Xinference-compatibility", + "-Xinline-classes", + "-Xintellij-plugin-root", + "-Xlegacy-smart-cast-after-try", + "-Xlist-phases", + "-Xmetadata-version", + "-Xmulti-platform", + "-Xexclude-from-dumping", + "-Xnew-inference", + "-Xno-check-actual", + "-Xno-inline", + "-Xopt-in", + "-Xphases-to-dump", + "-Xphases-to-dump-after", + "-Xphases-to-dump-before", + "-Xphases-to-validate", + "-Xphases-to-validate-after", + "-Xphases-to-validate-before", + "-Xplugin", + "-Xpolymorphic-signature", + "-Xprofile-phases", + "-Xproper-ieee754-comparisons", + "-Xread-deserialized-contracts", + "-Xreport-output-files", + "-Xreport-perf", + "-Xskip-metadata-version-check", + "-Xskip-prerelease-check", + "-Xsuppress-version-warnings", + "-Xuse-experimental", + "-Xuse-fir", + "-Xuse-fir-extended-checkers", + "-Xuse-mixed-named-arguments", + "-Xverbose-phases", +] diff --git a/src/main/starlark/core/repositories/kotlin/capabilities_1.6.bzl.com_github_jetbrains_kotlin.bazel b/src/main/starlark/core/repositories/kotlin/capabilities_1.6.bzl.com_github_jetbrains_kotlin.bazel new file mode 100644 index 000000000..c28f86258 --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/capabilities_1.6.bzl.com_github_jetbrains_kotlin.bazel @@ -0,0 +1,214 @@ +# Copyright 2022 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. + +KOTLIN_OPTS = [ + "-Xabi-stability", + "-Xadd-light-debug", + "-Xadd-modules", + "-Xallow-kotlin-package", + "-Xallow-no-source-files", + "-Xallow-result-return-type", + "-Xallow-unstable-dependencies", + "-Xassertions", + "-Xbackend-threads", + "-Xbinary", + "-Xbuild-file", + "-Xbuiltins-from-sources", + "-Xbundle-id", + "-Xcache-directories", + "-Xcache-directory", + "-Xcheck-phase-conditions", + "-Xcheck-state-at-external-calls", + "-Xcheck-sticky-phase-conditions", + "-Xcommon-sources", + "-Xcompile-java", + "-Xcontext-receivers", + "-Xcoverage", + "-Xcoverage-file", + "-Xdebug-info-version", + "-Xdebug-prefix-map", + "-Xdefault-script-extension", + "-Xdev-mode-overwriting-strategy", + "-Xdisable-default-scripting-plugin", + "-Xdisable-phases", + "-Xdisable-standard-script", + "-Xdisable-ultra-light-classes", + "-Xdump-declarations-to", + "-Xdump-directory", + "-Xdump-fqname", + "-Xdump-perf", + "-Xeffect-system", + "-Xemit-jvm-type-annotations", + "-Xemit-lazy-objc-header", + "-Xenable", + "-Xenable-builder-inference", + "-Xenable-extension-functions-in-externals", + "-Xenable-js-scripting", + "-Xenhance-type-parameter-types-to-def-not-null", + "-Xerror-tolerance-policy", + "-Xexclude-from-dumping", + "-Xexpect-actual-linker", + "-Xexplicit-api", + "-Xexport-kdoc", + "-Xexport-library", + "-Xextended-compiler-checks", + "-Xexternal-dependencies", + "-Xfake-override-validator", + "-Xframework-import-header", + "-Xfriend-modules", + "-Xfriend-modules-disabled", + "-Xfriend-paths", + "-Xfriend-paths", + "-Xg-generate-debug-trampoline", + "-Xg0", + "-Xgenerate-dts", + "-Xgenerate-strict-metadata-version", + "-Xinclude", + "-Xinference-compatibility", + "-Xinline-classes", + "-Xintellij-plugin-root", + "-Xir-base-class-in-metadata", + "-Xir-build-cache", + "-Xir-dce", + "-Xir-dce-driven", + "-Xir-dce-print-reachability-info", + "-Xir-dce-runtime-diagnostic", + "-Xir-do-not-clear-binding-context", + "-Xir-module-name", + "-Xir-new-ir2js", + "-Xir-only", + "-Xir-per-file", + "-Xir-per-module", + "-Xir-per-module-output-name", + "-Xir-produce-js", + "-Xir-produce-klib-dir", + "-Xir-produce-klib-file", + "-Xir-property-lazy-initialization", + "-Xir-property-lazy-initialization", + "-Xir-safe-external-boolean", + "-Xir-safe-external-boolean-diagnostic", + "-Xjava-package-prefix", + "-Xjava-source-roots", + "-Xjavac-arguments", + "-Xjps", + "-Xjspecify-annotations", + "-Xjsr305", + "-Xjvm-default", + "-Xjvm-enable-preview", + "-Xklib", + "-Xklib-normalize-absolute-path", + "-Xklib-relative-path-base", + "-Xlambdas", + "-Xlazy-ir-for-caches", + "-Xlegacy-smart-cast-after-try", + "-Xlibrary-to-cover", + "-Xlist-phases", + "-Xllvm-variant", + "-Xmeaningful-bridge-names", + "-Xmetadata-klib", + "-Xmetadata-only", + "-Xmetadata-version", + "-Xmodule-path", + "-Xmulti-platform", + "-Xmultifile-parts-inherit", + "-Xnew-inference", + "-Xno-call-assertions", + "-Xno-check-actual", + "-Xno-inline", + "-Xno-kotlin-nothing-value-exception", + "-Xno-objc-generics", + "-Xno-optimize", + "-Xno-optimized-callable-references", + "-Xno-param-assertions", + "-Xno-receiver-assertions", + "-Xno-reset-jar-timestamps", + "-Xno-unified-null-checks", + "-Xnullability-annotations", + "-Xopt-in", + "-Xoverride-konan-properties", + "-Xpartial-linkage", + "-Xphases-to-dump", + "-Xphases-to-dump-after", + "-Xphases-to-dump-before", + "-Xphases-to-validate", + "-Xphases-to-validate-after", + "-Xphases-to-validate-before", + "-Xplugin", + "-Xpre-link-caches", + "-Xprint-bitcode", + "-Xprint-descriptors", + "-Xprint-files", + "-Xprint-ir", + "-Xprint-ir-with-descriptors", + "-Xprint-locations", + "-Xprint-reachability-info", + "-Xprofile", + "-Xprofile-phases", + "-Xproper-ieee754-comparisons", + "-Xread-deserialized-contracts", + "-Xrefines-paths", + "-Xrepeat", + "-Xreport-output-files", + "-Xreport-perf", + "-Xrepositories", + "-Xruntime", + "-Xruntime-logs", + "-Xsam-conversions", + "-Xsanitize-parentheses", + "-Xsave-llvm-ir", + "-Xscript-resolver-environment", + "-Xself-upper-bound-inference", + "-Xserialize-ir", + "-Xsingle-module", + "-Xskip-metadata-version-check", + "-Xskip-prerelease-check", + "-Xstring-concat", + "-Xsupport-compatqual-checker-framework-annotations", + "-Xsuppress-deprecated-jvm-target-warning", + "-Xsuppress-missing-builtins-error", + "-Xsuppress-version-warnings", + "-Xtemporary-files-dir", + "-Xtype-enhancement-improvements-strict-mode", + "-Xtyped-arrays", + "-Xunrestricted-builder-inference", + "-Xuse-14-inline-classes-mangling-scheme", + "-Xuse-experimental", + "-Xuse-fast-jar-file-system", + "-Xuse-fir", + "-Xuse-fir-extended-checkers", + "-Xuse-ir", + "-Xuse-javac", + "-Xuse-mixed-named-arguments", + "-Xuse-old-backend", + "-Xuse-old-class-files-reading", + "-Xuse-type-table", + "-Xvalidate-bytecode", + "-Xvalidate-ir", + "-Xverbose-phases", + "-Xverify-bitcode", + "-Xverify-compiler", + "-Xverify-ir", + "-Xwasm", + "-Xwasm-debug-info", + "-Xwasm-kclass-fqn", + "-Xwasm-launcher", + "-Xworker-exception-handling", + "-Xallocator", + "-Xcheck-dependencies", + "-Xdestroy-runtime-mode", + "-Xfake-override-validator", + "-Xgc", + "-Xoverride-clang-options", + "-Xpurge-user-libs", +] diff --git a/src/main/starlark/core/repositories/kotlin/capabilities_1.7.bzl.com_github_jetbrains_kotlin.bazel b/src/main/starlark/core/repositories/kotlin/capabilities_1.7.bzl.com_github_jetbrains_kotlin.bazel new file mode 100644 index 000000000..8766bd4ab --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/capabilities_1.7.bzl.com_github_jetbrains_kotlin.bazel @@ -0,0 +1,225 @@ +# Copyright 2022 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. + +KOTLIN_OPTS = [ + "-Xabi-stability", + "-Xadd-light-debug", + "-Xadd-modules", + "-Xallow-any-scripts-in-source-roots", + "-Xallow-kotlin-package", + "-Xallow-no-source-files", + "-Xallow-result-return-type", + "-Xallow-unstable-dependencies", + "-Xassertions", + "-Xbackend-threads", + "-Xbinary", + "-Xbuild-file", + "-Xbuiltins-from-sources", + "-Xbundle-id", + "-Xcache-directories", + "-Xcache-directory", + "-Xcheck-phase-conditions", + "-Xcheck-state-at-external-calls", + "-Xcheck-sticky-phase-conditions", + "-Xcommon-sources", + "-Xcompile-java", + "-Xcontext-receivers", + "-Xcoverage", + "-Xcoverage-file", + "-Xdebug-info-version", + "-Xdebug-prefix-map", + "-Xdefault-script-extension", + "-Xdev-mode-overwriting-strategy", + "-Xdisable-default-scripting-plugin", + "-Xdisable-phases", + "-Xdisable-standard-script", + "-Xdisable-ultra-light-classes", + "-Xdump-declarations-to", + "-Xdump-directory", + "-Xdump-fqname", + "-Xdump-perf", + "-Xdump-tests-to", + "-Xeffect-system", + "-Xemit-jvm-type-annotations", + "-Xemit-lazy-objc-header", + "-Xenable", + "-Xenable-builder-inference", + "-Xenable-extension-functions-in-externals", + "-Xenable-incremental-compilation", + "-Xenable-js-scripting", + "-Xenhance-type-parameter-types-to-def-not-null", + "-Xerror-tolerance-policy", + "-Xexclude-from-dumping", + "-Xexpect-actual-linker", + "-Xexplicit-api", + "-Xexport-kdoc", + "-Xexport-library", + "-Xextended-compiler-checks", + "-Xexternal-dependencies", + "-Xfake-override-validator", + "-Xframework-import-header", + "-Xfriend-modules", + "-Xfriend-modules-disabled", + "-Xfriend-paths", + "-Xfriend-paths", + "-Xg-generate-debug-trampoline", + "-Xg0", + "-Xgenerate-dts", + "-Xgenerate-strict-metadata-version", + "-Xignore-const-optimization-errors", + "-Xinclude", + "-Xinference-compatibility", + "-Xinline-classes", + "-Xintellij-plugin-root", + "-Xir-base-class-in-metadata", + "-Xir-build-cache", + "-Xir-dce", + "-Xir-dce-print-reachability-info", + "-Xir-dce-runtime-diagnostic", + "-Xir-do-not-clear-binding-context", + "-Xir-generate-inline-anonymous-functions", + "-Xir-minimized-member-names", + "-Xir-module-name", + "-Xir-new-ir2js", + "-Xir-only", + "-Xir-per-file", + "-Xir-per-module", + "-Xir-per-module-output-name", + "-Xir-produce-js", + "-Xir-produce-klib-dir", + "-Xir-produce-klib-file", + "-Xir-property-lazy-initialization", + "-Xir-property-lazy-initialization", + "-Xir-safe-external-boolean", + "-Xir-safe-external-boolean-diagnostic", + "-Xjava-package-prefix", + "-Xjava-source-roots", + "-Xjavac-arguments", + "-Xjdk-release", + "-Xjps", + "-Xjspecify-annotations", + "-Xjsr305", + "-Xjvm-default", + "-Xjvm-enable-preview", + "-Xklib", + "-Xklib-enable-signature-clash-checks", + "-Xklib-normalize-absolute-path", + "-Xklib-relative-path-base", + "-Xlambdas", + "-Xlazy-ir-for-caches", + "-Xlegacy-smart-cast-after-try", + "-Xlibrary-to-cover", + "-Xlink-via-signatures", + "-Xlist-phases", + "-Xllvm-variant", + "-Xmeaningful-bridge-names", + "-Xmetadata-klib", + "-Xmetadata-only", + "-Xmetadata-version", + "-Xmodule-path", + "-Xmulti-platform", + "-Xmultifile-parts-inherit", + "-Xnew-inference", + "-Xno-call-assertions", + "-Xno-check-actual", + "-Xno-inline", + "-Xno-kotlin-nothing-value-exception", + "-Xno-objc-generics", + "-Xno-optimize", + "-Xno-optimized-callable-references", + "-Xno-param-assertions", + "-Xno-receiver-assertions", + "-Xno-reset-jar-timestamps", + "-Xno-unified-null-checks", + "-Xnullability-annotations", + "-Xoverride-konan-properties", + "-Xpartial-linkage", + "-Xpartial-linkage", + "-Xphases-to-dump", + "-Xphases-to-dump-after", + "-Xphases-to-dump-before", + "-Xphases-to-validate", + "-Xphases-to-validate-after", + "-Xphases-to-validate-before", + "-Xplugin", + "-Xpre-link-caches", + "-Xprint-bitcode", + "-Xprint-descriptors", + "-Xprint-files", + "-Xprint-ir", + "-Xprint-ir-with-descriptors", + "-Xprint-locations", + "-Xprint-reachability-info", + "-Xprofile", + "-Xprofile-phases", + "-Xproper-ieee754-comparisons", + "-Xread-deserialized-contracts", + "-Xrefines-paths", + "-Xrender-internal-diagnostic-names", + "-Xrepeat", + "-Xreport-output-files", + "-Xreport-perf", + "-Xrepositories", + "-Xruntime", + "-Xruntime-logs", + "-Xsam-conversions", + "-Xsanitize-parentheses", + "-Xsave-llvm-ir-after", + "-Xscript-resolver-environment", + "-Xself-upper-bound-inference", + "-Xserialize-ir", + "-Xsingle-module", + "-Xskip-metadata-version-check", + "-Xskip-prerelease-check", + "-Xstring-concat", + "-Xsupport-compatqual-checker-framework-annotations", + "-Xsuppress-deprecated-jvm-target-warning", + "-Xsuppress-missing-builtins-error", + "-Xsuppress-version-warnings", + "-Xtemporary-files-dir", + "-Xtype-enhancement-improvements-strict-mode", + "-Xtyped-arrays", + "-Xunrestricted-builder-inference", + "-Xuse-14-inline-classes-mangling-scheme", + "-Xuse-fast-jar-file-system", + "-Xuse-fir-extended-checkers", + "-Xuse-fir-ic", + "-Xuse-fir-lt", + "-Xuse-ir", + "-Xuse-javac", + "-Xuse-k2", + "-Xuse-mixed-named-arguments", + "-Xuse-old-backend", + "-Xuse-old-class-files-reading", + "-Xuse-type-table", + "-Xvalidate-bytecode", + "-Xvalidate-ir", + "-Xverbose-phases", + "-Xverify-bitcode", + "-Xverify-compiler", + "-Xverify-ir", + "-Xwasm", + "-Xwasm-debug-info", + "-Xwasm-enable-array-range-checks", + "-Xwasm-enable-asserts", + "-Xwasm-kclass-fqn", + "-Xworker-exception-handling", + "-Xallocator", + "-Xcheck-dependencies", + "-Xdestroy-runtime-mode", + "-Xfake-override-validator", + "-Xgc", + "-Xoverride-clang-options", + "-Xpurge-user-libs", +] diff --git a/src/main/starlark/core/repositories/kotlin/capabilities_1.8.bzl.com_github_jetbrains_kotlin.bazel b/src/main/starlark/core/repositories/kotlin/capabilities_1.8.bzl.com_github_jetbrains_kotlin.bazel new file mode 100644 index 000000000..4db302fcc --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/capabilities_1.8.bzl.com_github_jetbrains_kotlin.bazel @@ -0,0 +1,138 @@ +# Copyright 2022 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. + +KOTLIN_OPTS = [ + "-Xabi-stability", + "-Xadd-modules", + "-Xallow-any-scripts-in-source-roots", + "-Xallow-kotlin-package", + "-Xallow-no-source-files", + "-Xallow-result-return-type", + "-Xallow-unstable-dependencies", + "-Xassertions", + "-Xbackend-threads", + "-Xbuild-file", + "-Xbuiltins-from-sources", + "-Xcheck-phase-conditions", + "-Xcheck-sticky-phase-conditions", + "-Xcommon-sources", + "-Xcompile-java", + "-Xcompiler-plugin", + "-Xcontext-receivers", + "-Xdebug", + "-Xdefault-script-extension", + "-Xdisable-default-scripting-plugin", + "-Xdisable-phases", + "-Xdisable-standard-script", + "-Xdisable-ultra-light-classes", + "-Xdump-declarations-to", + "-Xdump-directory", + "-Xdump-fqname", + "-Xdump-perf", + "-Xeffect-system", + "-Xemit-jvm-type-annotations", + "-Xenable-builder-inference", + "-Xenable-incremental-compilation", + "-Xenhance-type-parameter-types-to-def-not-null", + "-Xexpect-actual-linker", + "-Xexplicit-api", + "-Xextended-compiler-checks", + "-Xfriend-paths", + "-Xgenerate-strict-metadata-version", + "-Xignore-const-optimization-errors", + "-Xinference-compatibility", + "-Xinline-classes", + "-Xintellij-plugin-root", + "-Xir-do-not-clear-binding-context", + "-Xjava-package-prefix", + "-Xjava-source-roots", + "-Xjavac-arguments", + "-Xjdk-release", + "-Xjspecify-annotations", + "-Xjsr305", + "-Xjvm-default", + "-Xjvm-enable-preview", + "-Xklib", + "-Xklib-enable-signature-clash-checks", + "-Xklib-normalize-absolute-path", + "-Xklib-relative-path-base", + "-Xlambdas", + "-Xlegacy-smart-cast-after-try", + "-Xlink-via-signatures", + "-Xlist-phases", + "-Xmetadata-version", + "-Xmodule-path", + "-Xmulti-platform", + "-Xmultifile-parts-inherit", + "-Xnew-inference", + "-Xno-call-assertions", + "-Xno-check-actual", + "-Xno-inline", + "-Xno-kotlin-nothing-value-exception", + "-Xno-new-java-annotation-targets", + "-Xno-optimize", + "-Xno-optimized-callable-references", + "-Xno-param-assertions", + "-Xno-receiver-assertions", + "-Xno-reset-jar-timestamps", + "-Xno-source-debug-extension", + "-Xno-unified-null-checks", + "-Xnullability-annotations", + "-Xphases-to-dump", + "-Xphases-to-dump-after", + "-Xphases-to-dump-before", + "-Xphases-to-validate", + "-Xphases-to-validate-after", + "-Xphases-to-validate-before", + "-Xplugin", + "-Xprofile", + "-Xprofile-phases", + "-Xproper-ieee754-comparisons", + "-Xread-deserialized-contracts", + "-Xrender-internal-diagnostic-names", + "-Xrepeat", + "-Xreport-output-files", + "-Xreport-perf", + "-Xsam-conversions", + "-Xsanitize-parentheses", + "-Xscript-resolver-environment", + "-Xself-upper-bound-inference", + "-Xserialize-ir", + "-Xskip-metadata-version-check", + "-Xskip-prerelease-check", + "-Xstring-concat", + "-Xsupport-compatqual-checker-framework-annotations", + "-Xsuppress-deprecated-jvm-target-warning", + "-Xsuppress-missing-builtins-error", + "-Xsuppress-version-warnings", + "-Xtype-enhancement-improvements-strict-mode", + "-Xunrestricted-builder-inference", + "-Xuse-14-inline-classes-mangling-scheme", + "-Xuse-fast-jar-file-system", + "-Xuse-fir-extended-checkers", + "-Xuse-fir-ic", + "-Xuse-fir-lt", + "-Xuse-ir", + "-Xuse-javac", + "-Xuse-k2", + "-Xuse-mixed-named-arguments", + "-Xuse-old-backend", + "-Xuse-old-class-files-reading", + "-Xuse-old-innerclasses-logic", + "-Xuse-type-table", + "-Xvalidate-bytecode", + "-Xvalidate-ir", + "-Xvalue-classes", + "-Xverbose-phases", +] diff --git a/src/main/starlark/core/repositories/kotlin/capabilities_legacy.bzl.com_github_jetbrains_kotlin.bazel b/src/main/starlark/core/repositories/kotlin/capabilities_legacy.bzl.com_github_jetbrains_kotlin.bazel new file mode 100644 index 000000000..1d0ad3903 --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/capabilities_legacy.bzl.com_github_jetbrains_kotlin.bazel @@ -0,0 +1,68 @@ +# Copyright 2022 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. + +KOTLIN_OPTS = [ + "-Xadd-compiler-builtins", + "-Xadd-modules", + "-Xallow-kotlin-package", + "-Xallow-result-return-type", + "-Xassertions", + "-Xbuild-file", + "-Xcommon-sources", + "-Xcompile-java", + "-Xcoroutines", + "-Xdisable-default-scripting-plugin", + "-Xdisable-standard-script", + "-Xdump-declarations-to", + "-Xdump-perf", + "-Xeffect-system", + "-Xexperimental", + "-Xfriend-modules", + "-Xfriend-modules-disabled", + "-Xfriend-paths", + "-Xgenerate-strict-metadata-version", + "-Xintellij-plugin-root", + "-Xjavac-arguments", + "-Xjps", + "-Xjsr305", + "-Xjvm-default", + "-Xlegacy-smart-cast-after-try", + "-Xload-builtins-from-dependencies", + "-Xmetadata-version", + "-Xmodule-path", + "-Xmulti-platform", + "-Xmultifile-parts-inherit", + "-Xnew-inference", + "-Xno-check-actual", + "-Xno-exception-on-explicit-equals-for-boxed-null", + "-Xno-inline", + "-Xnormalize-constructor-calls", + "-Xplugin", + "-Xprint-reachability-info", + "-Xproper-ieee754-comparisons", + "-Xread-deserialized-contracts", + "-Xreport-output-files", + "-Xscript-resolver-environment", + "-Xsingle-module", + "-Xskip-metadata-version-check", + "-Xskip-runtime-version-check", + "-Xstrict-java-nullability-assertions", + "-Xsupport-compatqual-checker-framework-annotations", + "-Xtyped-arrays", + "-Xuse-experimental", + "-Xuse-ir", + "-Xuse-javac", + "-Xuse-old-class-files-reading", + "-Xuse-type-table", +] diff --git a/src/main/starlark/core/repositories/kotlin/compiler.bzl b/src/main/starlark/core/repositories/kotlin/compiler.bzl new file mode 100644 index 000000000..ab03814bb --- /dev/null +++ b/src/main/starlark/core/repositories/kotlin/compiler.bzl @@ -0,0 +1,75 @@ +def _kotlin_compiler_impl(repository_ctx): + """Creates the kotlinc repository.""" + attr = repository_ctx.attr + repository_ctx.download_and_extract( + attr.urls, + sha256 = attr.sha256, + stripPrefix = "kotlinc", + ) + repository_ctx.file( + "WORKSPACE", + content = """workspace(name = "%s")""" % attr.name, + ) + repository_ctx.template( + "BUILD.bazel", + attr._template, + substitutions = { + "{{.KotlinRulesRepository}}": attr.kotlin_rules, + }, + executable = False, + ) + + repository_ctx.template( + "capabilities.bzl", + _get_capability_template(attr.compiler_version, attr._capabilities_templates), + executable = False, + ) + +def _get_capability_template(compiler_version, templates): + for ver, template in zip(_CAPABILITIES_TEMPLATES.keys(), templates): + if compiler_version.startswith(ver): + return template + + # After latest version + if compiler_version > _CAPABILITIES_TEMPLATES.keys()[-1]: + templates[-1] + + # Legacy + return templates[0] + +_CAPABILITIES_TEMPLATES = { + "legacy": "capabilities_legacy.bzl.com_github_jetbrains_kotlin.bazel", # keep first + "1.4": "capabilities_1.4.bzl.com_github_jetbrains_kotlin.bazel", + "1.5": "capabilities_1.5.bzl.com_github_jetbrains_kotlin.bazel", + "1.6": "capabilities_1.6.bzl.com_github_jetbrains_kotlin.bazel", + "1.7": "capabilities_1.7.bzl.com_github_jetbrains_kotlin.bazel", + "1.8": "capabilities_1.8.bzl.com_github_jetbrains_kotlin.bazel", +} + +kotlin_compiler_repository = repository_rule( + implementation = _kotlin_compiler_impl, + attrs = { + "urls": attr.string_list( + doc = "A list of urls for the kotlin compiler", + mandatory = True, + ), + "kotlin_rules": attr.string( + doc = "target of the kotlin rules.", + mandatory = True, + ), + "sha256": attr.string( + doc = "sha256 of the compiler archive", + ), + "compiler_version": attr.string( + doc = "compiler version", + ), + "_template": attr.label( + doc = "repository build file template", + default = "BUILD.com_github_jetbrains_kotlin.bazel", + ), + "_capabilities_templates": attr.label_list( + doc = "compiler capabilities file templates", + default = _CAPABILITIES_TEMPLATES.values(), + ), + }, +) diff --git a/src/main/starlark/core/repositories/ksp.bzl b/src/main/starlark/core/repositories/ksp.bzl index ffddd390e..f605c09e5 100644 --- a/src/main/starlark/core/repositories/ksp.bzl +++ b/src/main/starlark/core/repositories/ksp.bzl @@ -56,7 +56,7 @@ ksp_compiler_plugin_repository = repository_rule( ), "_template": attr.label( doc = "repository build file template", - default = ":BUILD.com_github_google_ksp.bazel", + default = "//src/main/starlark/core/repositories:BUILD.com_github_google_ksp.bazel", ), }, ) diff --git a/src/main/starlark/core/repositories/setup.bzl b/src/main/starlark/core/repositories/setup.bzl index 1af34b59a..bc5a113b8 100644 --- a/src/main/starlark/core/repositories/setup.bzl +++ b/src/main/starlark/core/repositories/setup.bzl @@ -17,7 +17,6 @@ load("@rules_jvm_external//:defs.bzl", "maven_install") load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories") load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") load("@build_bazel_rules_android//android:rules.bzl", "android_sdk_repository") -load("//src/main/starlark/core/repositories:versions.bzl", "versions") load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") def kt_configure(): @@ -63,11 +62,3 @@ def kt_configure(): bazel_skylib_workspace() android_sdk_repository(name = "androidsdk") - - [ - native.local_repository( - name = version, - path = "src/%s" % version, - ) - for version in versions.CORE - ] diff --git a/src/main/starlark/core/repositories/versions.bzl b/src/main/starlark/core/repositories/versions.bzl index 1572812f0..34fddd01c 100644 --- a/src/main/starlark/core/repositories/versions.bzl +++ b/src/main/starlark/core/repositories/versions.bzl @@ -74,24 +74,6 @@ versions = struct( SHA = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", URLS = ["https://github.com/bazelbuild/rules_android/archive/v%s.zip" % "0.1.1"], ), - CORE = { - "rkt_1_8": struct( - prefix = "1.8", - ), - "rkt_1_7": struct( - prefix = "1.7", - ), - "rkt_1_6": struct( - prefix = "1.6", - ), - "rkt_1_5": struct( - prefix = "1.5", - ), - "rkt_1_4": struct( - prefix = "1.4", - ), - "legacy": None, - }, # To update: https://github.com/bazelbuild/bazel-toolchains#latest-bazel-and-latest-ubuntu-1604-container RBE = struct( # This tarball intentionally does not have a SHA256 because the upstream URL can change without notice diff --git a/src/rkt_1_4/BUILD.bazel b/src/rkt_1_4/BUILD.bazel deleted file mode 100644 index 16a80bc46..000000000 --- a/src/rkt_1_4/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") - -release_archive( - name = "pkg", - srcs = ["WORKSPACE"], - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, - deps = [ - "//starlark/jvm:pkg", - "//starlark/kotlin:pkg", - ], -) diff --git a/src/rkt_1_4/BUILD.release.bazel b/src/rkt_1_4/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_4/WORKSPACE b/src/rkt_1_4/WORKSPACE deleted file mode 100644 index 269a87f2f..000000000 --- a/src/rkt_1_4/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -workspace(name = "rkt_1_4") diff --git a/src/rkt_1_4/starlark/BUILD.bazel b/src/rkt_1_4/starlark/BUILD.bazel deleted file mode 100644 index fa415960a..000000000 --- a/src/rkt_1_4/starlark/BUILD.bazel +++ /dev/null @@ -1,10 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "starlark", - visibility = ["//visibility:public"], - deps = [ - "//starlark/jvm", - "//starlark/kotlin", - ], -) diff --git a/src/rkt_1_4/starlark/jvm/BUILD.bazel b/src/rkt_1_4/starlark/jvm/BUILD.bazel deleted file mode 100644 index ca9e0bfa0..000000000 --- a/src/rkt_1_4/starlark/jvm/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "jvm", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], - deps = [ - "@dev_io_bazel_rules_kotlin//src/main/starlark", - ], -) diff --git a/src/rkt_1_4/starlark/jvm/BUILD.release.bazel b/src/rkt_1_4/starlark/jvm/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_4/starlark/jvm/opts.bzl b/src/rkt_1_4/starlark/jvm/opts.bzl deleted file mode 100644 index 7d8ee502d..000000000 --- a/src/rkt_1_4/starlark/jvm/opts.bzl +++ /dev/null @@ -1,78 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -_JOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "error": ["-Werror"], - "report": None, - }, - ), - "x_ep_disable_all_checks": struct( - args = dict( - default = False, - doc = "See javac -XepDisableAllChecks documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XepDisableAllChecks"], - }, - ), - "x_lint": struct( - args = dict( - default = [], - doc = "See javac -Xlint: documentation", - ), - type = attr.string_list, - value_to_flag = { - derive.info: derive.repeated_values_for("-Xlint:"), - }, - ), - "xd_suppress_notes": struct( - args = dict( - default = False, - doc = "See javac -XDsuppressNotes documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XDsuppressNotes"], - }, - ), -} - -def _javac_options_impl(ctx): - return struct( - providers = [ - JavacOptions(**{n: getattr(ctx.attr, n, None) for n in _JOPTS}), - ], - ) - -JavacOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _JOPTS.items() - }, -) - -kt_javac_options = rule( - implementation = _javac_options_impl, - doc = "Define java compiler options for `kt_jvm_*` rules with java sources.", - provides = [JavacOptions], - attrs = {n: o.type(**o.args) for n, o in _JOPTS.items()}, -) - -def javac_options_to_flags(javac_options): - """Translate JavacOptions to worker flags - - Args: - javac_options of type JavacOptions or None - Returns: - list of flags to add to the command line. - """ - return convert.javac_options_to_flags(_JOPTS, javac_options) diff --git a/src/rkt_1_4/starlark/kotlin/BUILD.bazel b/src/rkt_1_4/starlark/kotlin/BUILD.bazel deleted file mode 100644 index d3174c345..000000000 --- a/src/rkt_1_4/starlark/kotlin/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "kotlin", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], -) diff --git a/src/rkt_1_4/starlark/kotlin/BUILD.release.bazel b/src/rkt_1_4/starlark/kotlin/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_4/starlark/kotlin/opts.bzl b/src/rkt_1_4/starlark/kotlin/opts.bzl deleted file mode 100644 index 5c84668bc..000000000 --- a/src/rkt_1_4/starlark/kotlin/opts.bzl +++ /dev/null @@ -1,225 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -def _map_jvm_target_to_flag(version): - if not version: - return None - return ["-jvm-target=%s" % version] - -_KOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "report": None, - "error": ["-Werror"], - }, - ), - "include_stdlibs": struct( - args = dict( - default = "all", - doc = "Don't automatically include the Kotlin standard libraries into the classpath (stdlib and reflect).", - values = ["all", "stdlib", "none"], - ), - type = attr.string, - value_to_flag = { - "all": None, - "stdlib": ["-no-reflect"], - "none": ["-no-stdlib"], - }, - ), - "x_use_experimental": struct( - args = dict( - default = True, - doc = "Allow the experimental language features.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xuse-experimental=kotlin.Experimental"], - }, - ), - "x_skip_prerelease_check": struct( - args = dict( - default = False, - doc = "Suppress errors thrown when using pre-release classes.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xskip-prerelease-check"], - }, - ), - "x_inline_classes": struct( - args = dict( - default = False, - doc = "Enable experimental inline classes", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xinline-classes"], - }, - ), - "x_allow_result_return_type": struct( - args = dict( - default = False, - doc = "Enable kotlin.Result as a return type", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xallow-result-return-type"], - }, - ), - "x_jvm_default": struct( - args = dict( - default = "off", - doc = "Specifies that a JVM default method should be generated for non-abstract Kotlin interface member.", - values = ["off", "enable", "disable", "compatibility", "all-compatibility", "all"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "enable": ["-Xjvm-default=enable"], - "disable": ["-Xjvm-default=disable"], - "compatibility": ["-Xjvm-default=compatibility"], - "all-compatibility": ["-Xjvm-default=all-compatibility"], - "all": ["-Xjvm-default=all"], - }, - ), - "x_no_call_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions for arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-call-assertions"], - }, - ), - "x_no_param_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions on parameters of methods accessible from Java", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-param-assertions"], - }, - ), - "x_no_receiver_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertion for extension receiver arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-receiver-assertions"], - }, - ), - "x_no_optimized_callable_references": struct( - args = dict( - default = False, - doc = "Do not use optimized callable reference superclasses. Available from 1.4.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimized-callable-reference"], - }, - ), - "java_parameters": struct( - args = dict( - default = False, - doc = "Generate metadata for Java 1.8+ reflection on method parameters.", - ), - type = attr.bool, - value_to_flag = { - True: ["-java-parameters"], - }, - ), - "x_multi_platform": struct( - args = dict( - default = False, - doc = "Enable experimental language support for multi-platform projects", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xmulti-platform"], - }, - ), - "x_use_ir": struct( - args = dict( - default = False, - doc = "Enable or disable the experimental IR backend.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xuse-ir"], - }, - ), - "x_allow_jvm_ir_dependencies": struct( - args = dict( - default = False, - doc = "Suppress errors thrown when using dependencies not compiled by the IR backend.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xallow-jvm-ir-dependencies"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), - "jvm_target": struct( - args = dict( - default = "", - doc = "The -jvm_target flag. This is only tested at 1.8.", - values = ["1.6", "1.8", "9", "10", "11", "12", "13", "15", "16", "17"], - ), - type = attr.string, - value_to_flag = None, - map_value_to_flag = _map_jvm_target_to_flag, - ), -} - -KotlincOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _KOPTS.items() - }, -) - -def _kotlinc_options_impl(ctx): - return struct( - providers = [ - KotlincOptions(**{n: getattr(ctx.attr, n, None) for n in _KOPTS}), - ], - ) - -kt_kotlinc_options = rule( - implementation = _kotlinc_options_impl, - doc = "Define kotlin compiler options.", - provides = [KotlincOptions], - attrs = {n: o.type(**o.args) for n, o in _KOPTS.items()}, -) - -def kotlinc_options_to_flags(kotlinc_options): - """Translate KotlincOptions to worker flags - - Args: - kotlinc_options maybe containing KotlincOptions - Returns: - list of flags to add to the command line. - """ - return convert.kotlinc_options_to_flags(_KOPTS, kotlinc_options) diff --git a/src/rkt_1_5/BUILD.bazel b/src/rkt_1_5/BUILD.bazel deleted file mode 100644 index 16a80bc46..000000000 --- a/src/rkt_1_5/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") - -release_archive( - name = "pkg", - srcs = ["WORKSPACE"], - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, - deps = [ - "//starlark/jvm:pkg", - "//starlark/kotlin:pkg", - ], -) diff --git a/src/rkt_1_5/BUILD.release.bazel b/src/rkt_1_5/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_5/WORKSPACE b/src/rkt_1_5/WORKSPACE deleted file mode 100644 index e900be1a0..000000000 --- a/src/rkt_1_5/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -workspace(name = "rkt_1_5") diff --git a/src/rkt_1_5/starlark/BUILD.bazel b/src/rkt_1_5/starlark/BUILD.bazel deleted file mode 100644 index fa415960a..000000000 --- a/src/rkt_1_5/starlark/BUILD.bazel +++ /dev/null @@ -1,10 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "starlark", - visibility = ["//visibility:public"], - deps = [ - "//starlark/jvm", - "//starlark/kotlin", - ], -) diff --git a/src/rkt_1_5/starlark/jvm/BUILD.bazel b/src/rkt_1_5/starlark/jvm/BUILD.bazel deleted file mode 100644 index ca9e0bfa0..000000000 --- a/src/rkt_1_5/starlark/jvm/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "jvm", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], - deps = [ - "@dev_io_bazel_rules_kotlin//src/main/starlark", - ], -) diff --git a/src/rkt_1_5/starlark/jvm/BUILD.release.bazel b/src/rkt_1_5/starlark/jvm/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_5/starlark/jvm/opts.bzl b/src/rkt_1_5/starlark/jvm/opts.bzl deleted file mode 100644 index a019afd6f..000000000 --- a/src/rkt_1_5/starlark/jvm/opts.bzl +++ /dev/null @@ -1,92 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:derive.bzl", "derive") -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -_JOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "error": ["-Werror"], - "report": None, - }, - ), - "x_ep_disable_all_checks": struct( - args = dict( - default = False, - doc = "See javac -XepDisableAllChecks documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XepDisableAllChecks"], - }, - ), - "x_lint": struct( - args = dict( - default = [], - doc = "See javac -Xlint: documentation", - ), - type = attr.string_list, - value_to_flag = { - derive.info: derive.repeated_values_for("-Xlint:"), - }, - ), - "xd_suppress_notes": struct( - args = dict( - default = False, - doc = "See javac -XDsuppressNotes documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XDsuppressNotes"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), -} - -def _javac_options_impl(ctx): - return struct( - providers = [ - JavacOptions(**{n: getattr(ctx.attr, n, None) for n in _JOPTS}), - ], - ) - -JavacOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _JOPTS.items() - }, -) - -kt_javac_options = rule( - implementation = _javac_options_impl, - doc = "Define java compiler options for `kt_jvm_*` rules with java sources.", - provides = [JavacOptions], - attrs = {n: o.type(**o.args) for n, o in _JOPTS.items()}, -) - -def javac_options_to_flags(javac_options): - """Translate JavacOptions to worker flags - - Args: - javac_options of type JavacOptions or None - Returns: - list of flags to add to the command line. - """ - return convert.javac_options_to_flags(_JOPTS, javac_options) diff --git a/src/rkt_1_5/starlark/kotlin/BUILD.bazel b/src/rkt_1_5/starlark/kotlin/BUILD.bazel deleted file mode 100644 index d3174c345..000000000 --- a/src/rkt_1_5/starlark/kotlin/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "kotlin", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], -) diff --git a/src/rkt_1_5/starlark/kotlin/BUILD.release.bazel b/src/rkt_1_5/starlark/kotlin/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_5/starlark/kotlin/opts.bzl b/src/rkt_1_5/starlark/kotlin/opts.bzl deleted file mode 100644 index e1aa9dab6..000000000 --- a/src/rkt_1_5/starlark/kotlin/opts.bzl +++ /dev/null @@ -1,261 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -def _map_optin_class_to_flag(values): - return ["-Xopt-in=%s" % v for v in values] - -def _map_jvm_target_to_flag(version): - if not version: - return None - return ["-jvm-target=%s" % version] - -_KOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "report": None, - "error": ["-Werror"], - }, - ), - "include_stdlibs": struct( - args = dict( - default = "all", - doc = "Don't automatically include the Kotlin standard libraries into the classpath (stdlib and reflect).", - values = ["all", "stdlib", "none"], - ), - type = attr.string, - value_to_flag = { - "all": None, - "stdlib": ["-no-reflect"], - "none": ["-no-stdlib"], - }, - ), - "x_skip_prerelease_check": struct( - args = dict( - default = False, - doc = "Suppress errors thrown when using pre-release classes.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xskip-prerelease-check"], - }, - ), - "x_inline_classes": struct( - args = dict( - default = False, - doc = "Enable experimental inline classes", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xinline-classes"], - }, - ), - "x_allow_result_return_type": struct( - args = dict( - default = False, - doc = "Enable kotlin.Result as a return type", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xallow-result-return-type"], - }, - ), - "x_jvm_default": struct( - args = dict( - default = "off", - doc = "Specifies that a JVM default method should be generated for non-abstract Kotlin interface member.", - values = ["off", "enable", "disable", "compatibility", "all-compatibility", "all"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "enable": ["-Xjvm-default=enable"], - "disable": ["-Xjvm-default=disable"], - "compatibility": ["-Xjvm-default=compatibility"], - "all-compatibility": ["-Xjvm-default=all-compatibility"], - "all": ["-Xjvm-default=all"], - }, - ), - "x_no_call_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions for arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-call-assertions"], - }, - ), - "x_no_param_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions on parameters of methods accessible from Java", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-param-assertions"], - }, - ), - "x_no_receiver_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertion for extension receiver arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-receiver-assertions"], - }, - ), - "x_no_optimized_callable_references": struct( - args = dict( - default = False, - doc = "Do not use optimized callable reference superclasses. Available from 1.4.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimized-callable-reference"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), - "java_parameters": struct( - args = dict( - default = False, - doc = "Generate metadata for Java 1.8+ reflection on method parameters.", - ), - type = attr.bool, - value_to_flag = { - True: ["-java-parameters"], - }, - ), - "x_emit_jvm_type_annotations": struct( - args = dict( - default = False, - doc = "Basic support for type annotations in JVM bytecode.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xemit-jvm-type-annotations"], - }, - ), - "x_multi_platform": struct( - args = dict( - default = False, - doc = "Enable experimental language support for multi-platform projects", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xmulti-platform"], - }, - ), - "x_sam_conversions": struct( - args = dict( - default = "class", - doc = "Change codegen behavior of SAM/functional interfaces", - values = ["class", "indy"], - ), - type = attr.string, - value_to_flag = { - "class": ["-Xsam-conversions=class"], - "indy": ["-Xsam-conversions=indy"], - }, - ), - "x_lambdas": struct( - args = dict( - default = "class", - doc = "Change codegen behavior of lambdas", - values = ["class", "indy"], - ), - type = attr.string, - value_to_flag = { - "class": ["-Xlambdas=class"], - "indy": ["-Xlambdas=indy"], - }, - ), - "x_optin": struct( - args = dict( - default = [], - doc = "Define APIs to opt-in to.", - ), - type = attr.string_list, - value_to_flag = None, - map_value_to_flag = _map_optin_class_to_flag, - ), - "x_no_optimize": struct( - args = dict( - default = False, - doc = "Disable optimizations", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimize"], - }, - ), - "x_report_perf": struct( - args = dict( - default = False, - doc = "Report detailed performance statistics", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xreport-perf"], - }, - ), - "jvm_target": struct( - args = dict( - default = "", - doc = "The -jvm_target flag. This is only tested at 1.8.", - values = ["1.6", "1.8", "9", "10", "11", "12", "13", "15", "16", "17"], - ), - type = attr.string, - value_to_flag = None, - map_value_to_flag = _map_jvm_target_to_flag, - ), -} - -KotlincOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _KOPTS.items() - }, -) - -def _kotlinc_options_impl(ctx): - return struct( - providers = [ - KotlincOptions(**{n: getattr(ctx.attr, n, None) for n in _KOPTS}), - ], - ) - -kt_kotlinc_options = rule( - implementation = _kotlinc_options_impl, - doc = "Define kotlin compiler options.", - provides = [KotlincOptions], - attrs = {n: o.type(**o.args) for n, o in _KOPTS.items()}, -) - -def kotlinc_options_to_flags(kotlinc_options): - """Translate KotlincOptions to worker flags - - Args: - kotlinc_options maybe containing KotlincOptions - Returns: - list of flags to add to the command line. - """ - return convert.kotlinc_options_to_flags(_KOPTS, kotlinc_options) diff --git a/src/rkt_1_6/BUILD.bazel b/src/rkt_1_6/BUILD.bazel deleted file mode 100644 index 16a80bc46..000000000 --- a/src/rkt_1_6/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") - -release_archive( - name = "pkg", - srcs = ["WORKSPACE"], - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, - deps = [ - "//starlark/jvm:pkg", - "//starlark/kotlin:pkg", - ], -) diff --git a/src/rkt_1_6/BUILD.release.bazel b/src/rkt_1_6/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_6/WORKSPACE b/src/rkt_1_6/WORKSPACE deleted file mode 100644 index 3676c8ee0..000000000 --- a/src/rkt_1_6/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -workspace(name = "rkt_1_6") diff --git a/src/rkt_1_6/starlark/BUILD.bazel b/src/rkt_1_6/starlark/BUILD.bazel deleted file mode 100644 index fa415960a..000000000 --- a/src/rkt_1_6/starlark/BUILD.bazel +++ /dev/null @@ -1,10 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "starlark", - visibility = ["//visibility:public"], - deps = [ - "//starlark/jvm", - "//starlark/kotlin", - ], -) diff --git a/src/rkt_1_6/starlark/jvm/BUILD.bazel b/src/rkt_1_6/starlark/jvm/BUILD.bazel deleted file mode 100644 index ca9e0bfa0..000000000 --- a/src/rkt_1_6/starlark/jvm/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "jvm", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], - deps = [ - "@dev_io_bazel_rules_kotlin//src/main/starlark", - ], -) diff --git a/src/rkt_1_6/starlark/jvm/BUILD.release.bazel b/src/rkt_1_6/starlark/jvm/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_6/starlark/jvm/opts.bzl b/src/rkt_1_6/starlark/jvm/opts.bzl deleted file mode 100644 index a019afd6f..000000000 --- a/src/rkt_1_6/starlark/jvm/opts.bzl +++ /dev/null @@ -1,92 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:derive.bzl", "derive") -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -_JOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "error": ["-Werror"], - "report": None, - }, - ), - "x_ep_disable_all_checks": struct( - args = dict( - default = False, - doc = "See javac -XepDisableAllChecks documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XepDisableAllChecks"], - }, - ), - "x_lint": struct( - args = dict( - default = [], - doc = "See javac -Xlint: documentation", - ), - type = attr.string_list, - value_to_flag = { - derive.info: derive.repeated_values_for("-Xlint:"), - }, - ), - "xd_suppress_notes": struct( - args = dict( - default = False, - doc = "See javac -XDsuppressNotes documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XDsuppressNotes"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), -} - -def _javac_options_impl(ctx): - return struct( - providers = [ - JavacOptions(**{n: getattr(ctx.attr, n, None) for n in _JOPTS}), - ], - ) - -JavacOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _JOPTS.items() - }, -) - -kt_javac_options = rule( - implementation = _javac_options_impl, - doc = "Define java compiler options for `kt_jvm_*` rules with java sources.", - provides = [JavacOptions], - attrs = {n: o.type(**o.args) for n, o in _JOPTS.items()}, -) - -def javac_options_to_flags(javac_options): - """Translate JavacOptions to worker flags - - Args: - javac_options of type JavacOptions or None - Returns: - list of flags to add to the command line. - """ - return convert.javac_options_to_flags(_JOPTS, javac_options) diff --git a/src/rkt_1_6/starlark/kotlin/BUILD.bazel b/src/rkt_1_6/starlark/kotlin/BUILD.bazel deleted file mode 100644 index d3174c345..000000000 --- a/src/rkt_1_6/starlark/kotlin/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "kotlin", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], -) diff --git a/src/rkt_1_6/starlark/kotlin/BUILD.release.bazel b/src/rkt_1_6/starlark/kotlin/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_6/starlark/kotlin/opts.bzl b/src/rkt_1_6/starlark/kotlin/opts.bzl deleted file mode 100644 index 5051c49a1..000000000 --- a/src/rkt_1_6/starlark/kotlin/opts.bzl +++ /dev/null @@ -1,285 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -def _map_optin_class_to_flag(values): - return ["-opt-in=%s" % v for v in values] - -def _map_backend_threads_to_flag(n): - if n == 1: - return None - return ["-Xbackend-threads=%d" % n] - -def _map_jvm_target_to_flag(version): - if not version: - return None - return ["-jvm-target=%s" % version] - -_KOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "report": None, - "error": ["-Werror"], - }, - ), - "include_stdlibs": struct( - args = dict( - default = "all", - doc = "Don't automatically include the Kotlin standard libraries into the classpath (stdlib and reflect).", - values = ["all", "stdlib", "none"], - ), - type = attr.string, - value_to_flag = { - "all": None, - "stdlib": ["-no-reflect"], - "none": ["-no-stdlib"], - }, - ), - "x_skip_prerelease_check": struct( - args = dict( - default = False, - doc = "Suppress errors thrown when using pre-release classes.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xskip-prerelease-check"], - }, - ), - "x_inline_classes": struct( - args = dict( - default = False, - doc = "Enable experimental inline classes", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xinline-classes"], - }, - ), - "x_allow_result_return_type": struct( - args = dict( - default = False, - doc = "Enable kotlin.Result as a return type", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xallow-result-return-type"], - }, - ), - "x_jvm_default": struct( - args = dict( - default = "off", - doc = "Specifies that a JVM default method should be generated for non-abstract Kotlin interface member.", - values = ["off", "enable", "disable", "compatibility", "all-compatibility", "all"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "enable": ["-Xjvm-default=enable"], - "disable": ["-Xjvm-default=disable"], - "compatibility": ["-Xjvm-default=compatibility"], - "all-compatibility": ["-Xjvm-default=all-compatibility"], - "all": ["-Xjvm-default=all"], - }, - ), - "x_no_call_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions for arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-call-assertions"], - }, - ), - "x_no_param_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions on parameters of methods accessible from Java", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-param-assertions"], - }, - ), - "x_no_receiver_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertion for extension receiver arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-receiver-assertions"], - }, - ), - "x_no_optimized_callable_references": struct( - args = dict( - default = False, - doc = "Do not use optimized callable reference superclasses. Available from 1.4.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimized-callable-reference"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), - "java_parameters": struct( - args = dict( - default = False, - doc = "Generate metadata for Java 1.8+ reflection on method parameters.", - ), - type = attr.bool, - value_to_flag = { - True: ["-java-parameters"], - }, - ), - "x_multi_platform": struct( - args = dict( - default = False, - doc = "Enable experimental language support for multi-platform projects", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xmulti-platform"], - }, - ), - "x_emit_jvm_type_annotations": struct( - args = dict( - default = False, - doc = "Basic support for type annotations in JVM bytecode.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xemit-jvm-type-annotations"], - }, - ), - "x_sam_conversions": struct( - args = dict( - default = "class", - doc = "Change codegen behavior of SAM/functional interfaces", - values = ["class", "indy"], - ), - type = attr.string, - value_to_flag = { - "class": ["-Xsam-conversions=class"], - "indy": ["-Xsam-conversions=indy"], - }, - ), - "x_lambdas": struct( - args = dict( - default = "class", - doc = "Change codegen behavior of lambdas", - values = ["class", "indy"], - ), - type = attr.string, - value_to_flag = { - "class": ["-Xlambdas=class"], - "indy": ["-Xlambdas=indy"], - }, - ), - "x_optin": struct( - args = dict( - default = [], - doc = "Define APIs to opt-in to.", - ), - type = attr.string_list, - value_to_flag = None, - map_value_to_flag = _map_optin_class_to_flag, - ), - "x_use_fir": struct( - args = dict( - default = False, - doc = "Compile using the experimental Kotlin Front-end IR. Available from 1.6.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xuse-fir"], - }, - ), - "x_no_optimize": struct( - args = dict( - default = False, - doc = "Disable optimizations", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimize"], - }, - ), - "x_backend_threads": struct( - args = dict( - default = 1, - doc = "When using the IR backend, run lowerings by file in N parallel threads. 0 means use a thread per processor core. Default value is 1.", - ), - type = attr.int, - value_to_flag = None, - map_value_to_flag = _map_backend_threads_to_flag, - ), - "x_report_perf": struct( - args = dict( - default = False, - doc = "Report detailed performance statistics", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xreport-perf"], - }, - ), - "jvm_target": struct( - args = dict( - default = "", - doc = "The -jvm_target flag. This is only tested at 1.8.", - values = ["1.6", "1.8", "9", "10", "11", "12", "13", "15", "16", "17"], - ), - type = attr.string, - value_to_flag = None, - map_value_to_flag = _map_jvm_target_to_flag, - ), -} - -KotlincOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _KOPTS.items() - }, -) - -def _kotlinc_options_impl(ctx): - return struct( - providers = [ - KotlincOptions(**{n: getattr(ctx.attr, n, None) for n in _KOPTS}), - ], - ) - -kt_kotlinc_options = rule( - implementation = _kotlinc_options_impl, - doc = "Define kotlin compiler options.", - provides = [KotlincOptions], - attrs = {n: o.type(**o.args) for n, o in _KOPTS.items()}, -) - -def kotlinc_options_to_flags(kotlinc_options): - """Translate KotlincOptions to worker flags - - Args: - kotlinc_options maybe containing KotlincOptions - Returns: - list of flags to add to the command line. - """ - return convert.kotlinc_options_to_flags(_KOPTS, kotlinc_options) diff --git a/src/rkt_1_7/BUILD.bazel b/src/rkt_1_7/BUILD.bazel deleted file mode 100644 index 16a80bc46..000000000 --- a/src/rkt_1_7/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") - -release_archive( - name = "pkg", - srcs = ["WORKSPACE"], - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, - deps = [ - "//starlark/jvm:pkg", - "//starlark/kotlin:pkg", - ], -) diff --git a/src/rkt_1_7/BUILD.release.bazel b/src/rkt_1_7/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_7/WORKSPACE b/src/rkt_1_7/WORKSPACE deleted file mode 100644 index 6ad89700e..000000000 --- a/src/rkt_1_7/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -workspace(name = "rkt_1_7") diff --git a/src/rkt_1_7/starlark/BUILD.bazel b/src/rkt_1_7/starlark/BUILD.bazel deleted file mode 100644 index fa415960a..000000000 --- a/src/rkt_1_7/starlark/BUILD.bazel +++ /dev/null @@ -1,10 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "starlark", - visibility = ["//visibility:public"], - deps = [ - "//starlark/jvm", - "//starlark/kotlin", - ], -) diff --git a/src/rkt_1_7/starlark/jvm/BUILD.bazel b/src/rkt_1_7/starlark/jvm/BUILD.bazel deleted file mode 100644 index ca9e0bfa0..000000000 --- a/src/rkt_1_7/starlark/jvm/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "jvm", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], - deps = [ - "@dev_io_bazel_rules_kotlin//src/main/starlark", - ], -) diff --git a/src/rkt_1_7/starlark/jvm/BUILD.release.bazel b/src/rkt_1_7/starlark/jvm/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_7/starlark/jvm/opts.bzl b/src/rkt_1_7/starlark/jvm/opts.bzl deleted file mode 100644 index a019afd6f..000000000 --- a/src/rkt_1_7/starlark/jvm/opts.bzl +++ /dev/null @@ -1,92 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:derive.bzl", "derive") -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -_JOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "error": ["-Werror"], - "report": None, - }, - ), - "x_ep_disable_all_checks": struct( - args = dict( - default = False, - doc = "See javac -XepDisableAllChecks documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XepDisableAllChecks"], - }, - ), - "x_lint": struct( - args = dict( - default = [], - doc = "See javac -Xlint: documentation", - ), - type = attr.string_list, - value_to_flag = { - derive.info: derive.repeated_values_for("-Xlint:"), - }, - ), - "xd_suppress_notes": struct( - args = dict( - default = False, - doc = "See javac -XDsuppressNotes documentation", - ), - type = attr.bool, - value_to_flag = { - True: ["-XDsuppressNotes"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), -} - -def _javac_options_impl(ctx): - return struct( - providers = [ - JavacOptions(**{n: getattr(ctx.attr, n, None) for n in _JOPTS}), - ], - ) - -JavacOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _JOPTS.items() - }, -) - -kt_javac_options = rule( - implementation = _javac_options_impl, - doc = "Define java compiler options for `kt_jvm_*` rules with java sources.", - provides = [JavacOptions], - attrs = {n: o.type(**o.args) for n, o in _JOPTS.items()}, -) - -def javac_options_to_flags(javac_options): - """Translate JavacOptions to worker flags - - Args: - javac_options of type JavacOptions or None - Returns: - list of flags to add to the command line. - """ - return convert.javac_options_to_flags(_JOPTS, javac_options) diff --git a/src/rkt_1_7/starlark/kotlin/BUILD.bazel b/src/rkt_1_7/starlark/kotlin/BUILD.bazel deleted file mode 100644 index d3174c345..000000000 --- a/src/rkt_1_7/starlark/kotlin/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "kotlin", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], -) diff --git a/src/rkt_1_7/starlark/kotlin/BUILD.release.bazel b/src/rkt_1_7/starlark/kotlin/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_7/starlark/kotlin/opts.bzl b/src/rkt_1_7/starlark/kotlin/opts.bzl deleted file mode 100644 index bf31c19ea..000000000 --- a/src/rkt_1_7/starlark/kotlin/opts.bzl +++ /dev/null @@ -1,285 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/core/options:convert.bzl", "convert") - -def _map_optin_class_to_flag(values): - return ["-opt-in=%s" % v for v in values] - -def _map_backend_threads_to_flag(n): - if n == 1: - return None - return ["-Xbackend-threads=%d" % n] - -def _map_jvm_target_to_flag(version): - if not version: - return None - return ["-jvm-target=%s" % version] - -_KOPTS = { - "warn": struct( - args = dict( - default = "report", - doc = "Control warning behaviour.", - values = ["off", "report", "error"], - ), - type = attr.string, - value_to_flag = { - "off": ["-nowarn"], - "report": None, - "error": ["-Werror"], - }, - ), - "include_stdlibs": struct( - args = dict( - default = "all", - doc = "Don't automatically include the Kotlin standard libraries into the classpath (stdlib and reflect).", - values = ["all", "stdlib", "none"], - ), - type = attr.string, - value_to_flag = { - "all": None, - "stdlib": ["-no-reflect"], - "none": ["-no-stdlib"], - }, - ), - "x_skip_prerelease_check": struct( - args = dict( - default = False, - doc = "Suppress errors thrown when using pre-release classes.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xskip-prerelease-check"], - }, - ), - "x_inline_classes": struct( - args = dict( - default = False, - doc = "Enable experimental inline classes", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xinline-classes"], - }, - ), - "x_allow_result_return_type": struct( - args = dict( - default = False, - doc = "Enable kotlin.Result as a return type", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xallow-result-return-type"], - }, - ), - "x_jvm_default": struct( - args = dict( - default = "off", - doc = "Specifies that a JVM default method should be generated for non-abstract Kotlin interface member.", - values = ["off", "enable", "disable", "compatibility", "all-compatibility", "all"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "enable": ["-Xjvm-default=enable"], - "disable": ["-Xjvm-default=disable"], - "compatibility": ["-Xjvm-default=compatibility"], - "all-compatibility": ["-Xjvm-default=all-compatibility"], - "all": ["-Xjvm-default=all"], - }, - ), - "x_no_call_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions for arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-call-assertions"], - }, - ), - "x_no_param_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertions on parameters of methods accessible from Java", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-param-assertions"], - }, - ), - "x_no_receiver_assertions": struct( - args = dict( - default = False, - doc = "Don't generate not-null assertion for extension receiver arguments of platform types", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-receiver-assertions"], - }, - ), - "x_no_optimized_callable_references": struct( - args = dict( - default = False, - doc = "Do not use optimized callable reference superclasses. Available from 1.4.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimized-callable-reference"], - }, - ), - "x_explicit_api_mode": struct( - args = dict( - default = "off", - doc = "Enable explicit API mode for Kotlin libraries.", - values = ["off", "warning", "strict"], - ), - type = attr.string, - value_to_flag = { - "off": None, - "warning": ["-Xexplicit-api=warning"], - "strict": ["-Xexplicit-api=strict"], - }, - ), - "java_parameters": struct( - args = dict( - default = False, - doc = "Generate metadata for Java 1.8+ reflection on method parameters.", - ), - type = attr.bool, - value_to_flag = { - True: ["-java-parameters"], - }, - ), - "x_multi_platform": struct( - args = dict( - default = False, - doc = "Enable experimental language support for multi-platform projects", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xmulti-platform"], - }, - ), - "x_sam_conversions": struct( - args = dict( - default = "class", - doc = "Change codegen behavior of SAM/functional interfaces", - values = ["class", "indy"], - ), - type = attr.string, - value_to_flag = { - "class": ["-Xsam-conversions=class"], - "indy": ["-Xsam-conversions=indy"], - }, - ), - "x_lambdas": struct( - args = dict( - default = "class", - doc = "Change codegen behavior of lambdas", - values = ["class", "indy"], - ), - type = attr.string, - value_to_flag = { - "class": ["-Xlambdas=class"], - "indy": ["-Xlambdas=indy"], - }, - ), - "x_emit_jvm_type_annotations": struct( - args = dict( - default = False, - doc = "Basic support for type annotations in JVM bytecode.", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xemit-jvm-type-annotations"], - }, - ), - "x_optin": struct( - args = dict( - default = [], - doc = "Define APIs to opt-in to.", - ), - type = attr.string_list, - value_to_flag = None, - map_value_to_flag = _map_optin_class_to_flag, - ), - "x_use_k2": struct( - args = dict( - default = False, - doc = "Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xuse-k2"], - }, - ), - "x_no_optimize": struct( - args = dict( - default = False, - doc = "Disable optimizations", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xno-optimize"], - }, - ), - "x_backend_threads": struct( - args = dict( - default = 1, - doc = "When using the IR backend, run lowerings by file in N parallel threads. 0 means use a thread per processor core. Default value is 1.", - ), - type = attr.int, - value_to_flag = None, - map_value_to_flag = _map_backend_threads_to_flag, - ), - "x_report_perf": struct( - args = dict( - default = False, - doc = "Report detailed performance statistics", - ), - type = attr.bool, - value_to_flag = { - True: ["-Xreport-perf"], - }, - ), - "jvm_target": struct( - args = dict( - default = "", - doc = "The -jvm_target flag. This is only tested at 1.8.", - values = ["1.6", "1.8", "9", "10", "11", "12", "13", "15", "16", "17"], - ), - type = attr.string, - value_to_flag = None, - map_value_to_flag = _map_jvm_target_to_flag, - ), -} - -KotlincOptions = provider( - fields = { - name: o.args["doc"] - for name, o in _KOPTS.items() - }, -) - -def _kotlinc_options_impl(ctx): - return struct( - providers = [ - KotlincOptions(**{n: getattr(ctx.attr, n, None) for n in _KOPTS}), - ], - ) - -kt_kotlinc_options = rule( - implementation = _kotlinc_options_impl, - doc = "Define kotlin compiler options.", - provides = [KotlincOptions], - attrs = {n: o.type(**o.args) for n, o in _KOPTS.items()}, -) - -def kotlinc_options_to_flags(kotlinc_options): - """Translate KotlincOptions to worker flags - - Args: - kotlinc_options maybe containing KotlincOptions - Returns: - list of flags to add to the command line. - """ - return convert.javac_options_to_flags(_KOPTS, kotlinc_options) diff --git a/src/rkt_1_8/BUILD.bazel b/src/rkt_1_8/BUILD.bazel deleted file mode 100644 index 16a80bc46..000000000 --- a/src/rkt_1_8/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") - -release_archive( - name = "pkg", - srcs = ["WORKSPACE"], - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, - deps = [ - "//starlark/jvm:pkg", - "//starlark/kotlin:pkg", - ], -) diff --git a/src/rkt_1_8/BUILD.release.bazel b/src/rkt_1_8/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_8/WORKSPACE b/src/rkt_1_8/WORKSPACE deleted file mode 100644 index 7515f9585..000000000 --- a/src/rkt_1_8/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -workspace(name = "rkt_1_8") diff --git a/src/rkt_1_8/starlark/BUILD.bazel b/src/rkt_1_8/starlark/BUILD.bazel deleted file mode 100644 index fa415960a..000000000 --- a/src/rkt_1_8/starlark/BUILD.bazel +++ /dev/null @@ -1,10 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "starlark", - visibility = ["//visibility:public"], - deps = [ - "//starlark/jvm", - "//starlark/kotlin", - ], -) diff --git a/src/rkt_1_8/starlark/jvm/BUILD.bazel b/src/rkt_1_8/starlark/jvm/BUILD.bazel deleted file mode 100644 index ca9e0bfa0..000000000 --- a/src/rkt_1_8/starlark/jvm/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "jvm", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], - deps = [ - "@dev_io_bazel_rules_kotlin//src/main/starlark", - ], -) diff --git a/src/rkt_1_8/starlark/jvm/BUILD.release.bazel b/src/rkt_1_8/starlark/jvm/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/rkt_1_8/starlark/kotlin/BUILD.bazel b/src/rkt_1_8/starlark/kotlin/BUILD.bazel deleted file mode 100644 index d3174c345..000000000 --- a/src/rkt_1_8/starlark/kotlin/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@dev_io_bazel_rules_kotlin//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files( - ["opts.bzl"], - visibility = ["//visibility:public"], -) - -release_archive( - name = "pkg", - srcs = glob(["*.bzl"]), - src_map = { - "BUILD.release.bazel": "BUILD.bazel", - }, -) - -bzl_library( - name = "kotlin", - srcs = glob(["*.bzl"]), - visibility = ["//visibility:public"], -) diff --git a/src/rkt_1_8/starlark/kotlin/BUILD.release.bazel b/src/rkt_1_8/starlark/kotlin/BUILD.release.bazel deleted file mode 100644 index e69de29bb..000000000