diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 68ee6f5a6..3bbf354b0 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -2,7 +2,7 @@ validate_config: 1 bazel: 6.3.2 buildifier: - version: 6.1.0 + version: 6.3.3 # no lint warnings for the moment. They are basically a smoke alarm in hell. # keep this argument in sync with .pre-commit-config.yaml warnings: "-confusing-name,-constant-glob,-duplicated-name,-function-docstring,-function-docstring-args,-function-docstring-header,-module-docstring,-name-conventions,-no-effect,-constant-glob,-provider-params,-print,-rule-impl-return,-bzl-visibility,-unnamed-macro,-uninitialized,-unreachable" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7050f8642..d6c2a9ca3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/keith/pre-commit-buildifier - rev: 6.1.0 + rev: 6.3.3 hooks: - id: buildifier args: &args diff --git a/BUILD b/BUILD index 80e6873aa..d50524698 100644 --- a/BUILD +++ b/BUILD @@ -1,3 +1,5 @@ +load("//kotlin:lint.bzl", "ktlint_config") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,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("//kotlin:lint.bzl", "ktlint_config") exports_files([ "scripts/noop.sh", diff --git a/examples/android/libKtAndroid/BUILD.bazel b/examples/android/libKtAndroid/BUILD.bazel index c8f280ae5..8a4d02cb9 100644 --- a/examples/android/libKtAndroid/BUILD.bazel +++ b/examples/android/libKtAndroid/BUILD.bazel @@ -1,6 +1,6 @@ -load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin", "kt_ksp_plugin") -load("@rules_kotlin//kotlin:android.bzl", "kt_android_library") load("@rules_java//java:defs.bzl", "java_plugin") +load("@rules_kotlin//kotlin:android.bzl", "kt_android_library") +load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin", "kt_ksp_plugin") kt_compiler_plugin( name = "serialization_plugin", diff --git a/examples/dagger/BUILD b/examples/dagger/BUILD index 6ff82f9c4..32d85e0e5 100644 --- a/examples/dagger/BUILD +++ b/examples/dagger/BUILD @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@rules_java//java:defs.bzl", "java_binary") -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") load("@rules_kotlin//kotlin:core.bzl", "define_kt_toolchain") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:private"]) diff --git a/examples/jetpack_compose/BUILD b/examples/jetpack_compose/BUILD index 7a44e865d..e9b21d932 100644 --- a/examples/jetpack_compose/BUILD +++ b/examples/jetpack_compose/BUILD @@ -1,5 +1,5 @@ -load("@rules_kotlin//kotlin:core.bzl", "define_kt_toolchain", "kt_compiler_plugin") load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain") +load("@rules_kotlin//kotlin:core.bzl", "define_kt_toolchain", "kt_compiler_plugin") # Java Toolchain diff --git a/examples/ksp/BUILD b/examples/ksp/BUILD index d6c194b32..18953fbdc 100644 --- a/examples/ksp/BUILD +++ b/examples/ksp/BUILD @@ -1,3 +1,6 @@ +load("@bazel_skylib//rules:build_test.bzl", "build_test") +load("@rules_java//java:defs.bzl", "java_binary", "java_plugin") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@rules_kotlin//kotlin:core.bzl", "define_kt_toolchain", "kt_ksp_plugin") -load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("@rules_java//java:defs.bzl", "java_binary", "java_plugin") load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/examples/node/coroutines-helloworld/BUILD b/examples/node/coroutines-helloworld/BUILD index 2e1112610..b2265080d 100644 --- a/examples/node/coroutines-helloworld/BUILD +++ b/examples/node/coroutines-helloworld/BUILD @@ -1,3 +1,5 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@rules_kotlin//kotlin:js.bzl", "kt_js_library") -load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") kt_js_library( name = "app", diff --git a/examples/node/express/BUILD b/examples/node/express/BUILD index a8b04efe9..6b7edbe29 100644 --- a/examples/node/express/BUILD +++ b/examples/node/express/BUILD @@ -1,3 +1,5 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@rules_kotlin//kotlin:js.bzl", "kt_js_library") -load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") # routes and auth have acme prepended to the rule name as these are the names of the resulting jars. The name of the # jar is the name of the module, and thus the name of the require statements. diff --git a/examples/plugin/src/allopen/BUILD b/examples/plugin/src/allopen/BUILD index 437fa913a..f6fc0b69f 100644 --- a/examples/plugin/src/allopen/BUILD +++ b/examples/plugin/src/allopen/BUILD @@ -1,5 +1,5 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") kt_compiler_plugin( name = "open_for_testing_plugin", diff --git a/examples/plugin/src/noarg/BUILD b/examples/plugin/src/noarg/BUILD index 0b1b178af..bcadf95df 100644 --- a/examples/plugin/src/noarg/BUILD +++ b/examples/plugin/src/noarg/BUILD @@ -1,5 +1,5 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") kt_compiler_plugin( name = "no_arg_plugin", diff --git a/examples/plugin/src/parcelize/BUILD b/examples/plugin/src/parcelize/BUILD index 0fc4a8884..88f733f85 100644 --- a/examples/plugin/src/parcelize/BUILD +++ b/examples/plugin/src/parcelize/BUILD @@ -1,5 +1,5 @@ -load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin") load("@rules_kotlin//kotlin:android.bzl", "kt_android_library") +load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin") load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") kt_compiler_plugin( diff --git a/examples/plugin/src/sam_with_receiver/BUILD b/examples/plugin/src/sam_with_receiver/BUILD index 22e36ed07..048f0bc58 100644 --- a/examples/plugin/src/sam_with_receiver/BUILD +++ b/examples/plugin/src/sam_with_receiver/BUILD @@ -1,6 +1,6 @@ +load("@rules_java//java:defs.bzl", "java_library") load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin") load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") -load("@rules_java//java:defs.bzl", "java_library") kt_compiler_plugin( name = "sam_with_receiver_plugin", diff --git a/kotlin/BUILD b/kotlin/BUILD index 8ef4e35c4..fe50b275d 100644 --- a/kotlin/BUILD +++ b/kotlin/BUILD @@ -1,3 +1,5 @@ +load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,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("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc") release_archive( name = "pkg", diff --git a/kotlin/compiler/BUILD b/kotlin/compiler/BUILD index 2afe7199a..f0698661d 100644 --- a/kotlin/compiler/BUILD +++ b/kotlin/compiler/BUILD @@ -1,3 +1,5 @@ +load("//src/main/starlark/release:packager.bzl", "release_archive") + # Copyright 2020 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +15,6 @@ # limitations under the License. load(":compiler.bzl", "kt_configure_compiler") load(":ksp.bzl", "kt_configure_ksp") -load("//src/main/starlark/release:packager.bzl", "release_archive") package(default_visibility = ["//visibility:public"]) diff --git a/kotlin/compiler/compiler.bzl b/kotlin/compiler/compiler.bzl index 128d0aad7..0fac184d2 100644 --- a/kotlin/compiler/compiler.bzl +++ b/kotlin/compiler/compiler.bzl @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//kotlin:jvm.bzl", "kt_jvm_import") -load("//kotlin:js.bzl", "kt_js_import") load("@rules_java//java:defs.bzl", "java_import") +load("//kotlin:js.bzl", "kt_js_import") +load("//kotlin:jvm.bzl", "kt_jvm_import") load("//kotlin/internal:defs.bzl", _KT_COMPILER_REPO = "KT_COMPILER_REPO") _KT_COMPILER_REPO_PREFIX = "@" + _KT_COMPILER_REPO + "//:" diff --git a/kotlin/core.bzl b/kotlin/core.bzl index bde5aec64..a43a3eb3b 100644 --- a/kotlin/core.bzl +++ b/kotlin/core.bzl @@ -3,16 +3,16 @@ load( _kt_javac_options = "kt_javac_options", _kt_kotlinc_options = "kt_kotlinc_options", ) -load( - "//kotlin/internal/jvm:jvm.bzl", - _kt_compiler_plugin = "kt_compiler_plugin", - _kt_ksp_plugin = "kt_ksp_plugin", -) load( "//kotlin/internal:toolchains.bzl", _define_kt_toolchain = "define_kt_toolchain", _kt_register_toolchains = "kt_register_toolchains", ) +load( + "//kotlin/internal/jvm:jvm.bzl", + _kt_compiler_plugin = "kt_compiler_plugin", + _kt_ksp_plugin = "kt_ksp_plugin", +) define_kt_toolchain = _define_kt_toolchain kt_register_toolchains = _kt_register_toolchains diff --git a/kotlin/internal/BUILD b/kotlin/internal/BUILD index b98b89da9..2605db892 100644 --- a/kotlin/internal/BUILD +++ b/kotlin/internal/BUILD @@ -1,3 +1,5 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + # Copyright 2020 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +15,6 @@ # limitations under the License. load("//kotlin/internal:toolchains.bzl", "kt_configure_toolchains") load("//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") # Configures the toolchains kt_configure_toolchains() diff --git a/kotlin/internal/js/BUILD b/kotlin/internal/js/BUILD index 6f0144d77..291613a5c 100644 --- a/kotlin/internal/js/BUILD +++ b/kotlin/internal/js/BUILD @@ -1,3 +1,4 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@rules_python//python:defs.bzl", "py_binary") # Copyright 2018 The Bazel Authors. All rights reserved. @@ -14,7 +15,6 @@ load("@rules_python//python:defs.bzl", "py_binary") # See the License for the specific language governing permissions and # limitations under the License. load("//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") # TODO(https://github.com/bazelbuild/rules_kotlin/issues/270): Replace with Starlark py_binary( diff --git a/kotlin/internal/jvm/BUILD b/kotlin/internal/jvm/BUILD index ea20fb8ef..c7419b123 100644 --- a/kotlin/internal/jvm/BUILD +++ b/kotlin/internal/jvm/BUILD @@ -1,3 +1,5 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,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("@bazel_skylib//:bzl_library.bzl", "bzl_library") exports_files(["jetbrains-deshade.jarjar"]) diff --git a/kotlin/internal/jvm/android.bzl b/kotlin/internal/jvm/android.bzl index b43f3c686..2327772d6 100644 --- a/kotlin/internal/jvm/android.bzl +++ b/kotlin/internal/jvm/android.bzl @@ -1,3 +1,9 @@ +load( + "@build_bazel_rules_android//android:rules.bzl", + _android_library = "android_library", + _android_local_test = "android_local_test", +) + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,11 +21,6 @@ load( "//kotlin/internal/jvm:jvm.bzl", _kt_jvm_library = "kt_jvm_library", ) -load( - "@build_bazel_rules_android//android:rules.bzl", - _android_library = "android_library", - _android_local_test = "android_local_test", -) _ANDROID_SDK_JAR = "%s" % Label("//third_party:android_sdk") diff --git a/kotlin/internal/jvm/compile.bzl b/kotlin/internal/jvm/compile.bzl index cc692e96e..654d032af 100644 --- a/kotlin/internal/jvm/compile.bzl +++ b/kotlin/internal/jvm/compile.bzl @@ -1,3 +1,9 @@ +load( + "@bazel_tools//tools/jdk:toolchain_utils.bzl", + "find_java_runtime_toolchain", + "find_java_toolchain", +) + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,10 +23,6 @@ load( _KtJvmInfo = "KtJvmInfo", _TOOLCHAIN_TYPE = "TOOLCHAIN_TYPE", ) -load( - "//kotlin/internal/jvm:plugins.bzl", - _plugin_mappers = "mappers", -) load( "//kotlin/internal:opts.bzl", "JavacOptions", @@ -33,17 +35,16 @@ load( _associate_utils = "associate_utils", ) load( - "//kotlin/internal/utils:utils.bzl", - _utils = "utils", + "//kotlin/internal/jvm:plugins.bzl", + _plugin_mappers = "mappers", ) load( "//kotlin/internal/utils:sets.bzl", _sets = "sets", ) load( - "@bazel_tools//tools/jdk:toolchain_utils.bzl", - "find_java_runtime_toolchain", - "find_java_toolchain", + "//kotlin/internal/utils:utils.bzl", + _utils = "utils", ) # UTILITY ############################################################################################################## diff --git a/kotlin/internal/jvm/impl.bzl b/kotlin/internal/jvm/impl.bzl index 03b3d0c4b..78116f477 100644 --- a/kotlin/internal/jvm/impl.bzl +++ b/kotlin/internal/jvm/impl.bzl @@ -1,3 +1,12 @@ +load( + "//kotlin/internal:defs.bzl", + _JavaPluginInfo = "JavaPluginInfo", + _KspPluginInfo = "KspPluginInfo", + _KtCompilerPluginInfo = "KtCompilerPluginInfo", + _KtJvmInfo = "KtJvmInfo", + _TOOLCHAIN_TYPE = "TOOLCHAIN_TYPE", +) + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,14 +25,6 @@ load( "export_only_providers", _kt_jvm_produce_jar_actions = "kt_jvm_produce_jar_actions", ) -load( - "//kotlin/internal:defs.bzl", - _JavaPluginInfo = "JavaPluginInfo", - _KspPluginInfo = "KspPluginInfo", - _KtCompilerPluginInfo = "KtCompilerPluginInfo", - _KtJvmInfo = "KtJvmInfo", - _TOOLCHAIN_TYPE = "TOOLCHAIN_TYPE", -) load( "//kotlin/internal/utils:utils.bzl", _utils = "utils", diff --git a/kotlin/internal/lint/ktlint_test.bzl b/kotlin/internal/lint/ktlint_test.bzl index e72b23fe2..7a8c5dd91 100644 --- a/kotlin/internal/lint/ktlint_test.bzl +++ b/kotlin/internal/lint/ktlint_test.bzl @@ -1,6 +1,6 @@ +load("//kotlin/internal/utils:windows.bzl", "create_windows_native_launcher_script") load(":editorconfig.bzl", "get_editorconfig", "is_android_rules_enabled", "is_experimental_rules_enabled") load(":ktlint_config.bzl", "KtlintConfigInfo") -load("//kotlin/internal/utils:windows.bzl", "create_windows_native_launcher_script") def _ktlint(ctx, srcs, editorconfig, enabled_android_rules, enabled_experimental_rules): """Generates a test action linting the input files. diff --git a/kotlin/internal/opts.bzl b/kotlin/internal/opts.bzl index e9361d9cf..118c4da21 100644 --- a/kotlin/internal/opts.bzl +++ b/kotlin/internal/opts.bzl @@ -12,18 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -load( - "//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( "//src/main/starlark/core/options:opts.javac.bzl", _JavacOptions = "JavacOptions", _javac_options_to_flags = "javac_options_to_flags", _kt_javac_options = "kt_javac_options", ) +load( + "//src/main/starlark/core/options:opts.kotlinc.bzl", + _KotlincOptions = "KotlincOptions", + _kotlinc_options_to_flags = "kotlinc_options_to_flags", + _kt_kotlinc_options = "kt_kotlinc_options", +) JavacOptions = _JavacOptions javac_options_to_flags = _javac_options_to_flags diff --git a/kotlin/internal/toolchains.bzl b/kotlin/internal/toolchains.bzl index dfc9eb70a..b67838d69 100644 --- a/kotlin/internal/toolchains.bzl +++ b/kotlin/internal/toolchains.bzl @@ -1,3 +1,11 @@ +load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") +load( + "//kotlin/internal:defs.bzl", + _KT_COMPILER_REPO = "KT_COMPILER_REPO", + _KtJsInfo = "KtJsInfo", + _TOOLCHAIN_TYPE = "TOOLCHAIN_TYPE", +) + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,13 +26,6 @@ load( "kt_javac_options", "kt_kotlinc_options", ) -load( - "//kotlin/internal:defs.bzl", - _KT_COMPILER_REPO = "KT_COMPILER_REPO", - _KtJsInfo = "KtJsInfo", - _TOOLCHAIN_TYPE = "TOOLCHAIN_TYPE", -) -load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") """Kotlin Toolchains diff --git a/kotlin/internal/utils/BUILD b/kotlin/internal/utils/BUILD index 0e4c69d4b..a6d63432b 100644 --- a/kotlin/internal/utils/BUILD +++ b/kotlin/internal/utils/BUILD @@ -1,3 +1,5 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,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("@bazel_skylib//:bzl_library.bzl", "bzl_library") release_archive( name = "pkg", diff --git a/kotlin/jvm.bzl b/kotlin/jvm.bzl index 944b8fc04..65a6ae00a 100644 --- a/kotlin/jvm.bzl +++ b/kotlin/jvm.bzl @@ -1,3 +1,7 @@ +load( + "//kotlin/internal:opts.bzl", + _kt_javac_options = "kt_javac_options", +) load( "//kotlin/internal/jvm:jvm.bzl", _kt_jvm_binary = "kt_jvm_binary", @@ -5,10 +9,6 @@ load( _kt_jvm_library = "kt_jvm_library", _kt_jvm_test = "kt_jvm_test", ) -load( - "//kotlin/internal:opts.bzl", - _kt_javac_options = "kt_javac_options", -) kt_javac_options = _kt_javac_options kt_jvm_binary = _kt_jvm_binary diff --git a/kotlin/kotlin.bzl b/kotlin/kotlin.bzl index fe9ba59bd..4eb3c8d1f 100644 --- a/kotlin/kotlin.bzl +++ b/kotlin/kotlin.bzl @@ -12,36 +12,36 @@ # See the License for the specific language governing permissions and # limitations under the License. -load( - ":jvm.bzl", - _kt_jvm_binary = "kt_jvm_binary", - _kt_jvm_import = "kt_jvm_import", - _kt_jvm_library = "kt_jvm_library", - _kt_jvm_test = "kt_jvm_test", -) load( ":android.bzl", _kt_android_library = "kt_android_library", _kt_android_local_test = "kt_android_local_test", ) +load( + ":core.bzl", + _define_kt_toolchain = "define_kt_toolchain", + _kt_compiler_plugin = "kt_compiler_plugin", + _kt_ksp_plugin = "kt_ksp_plugin", + _kt_register_toolchains = "kt_register_toolchains", +) load( ":js.bzl", _kt_js_import = "kt_js_import", _kt_js_library = "kt_js_library", ) +load( + ":jvm.bzl", + _kt_jvm_binary = "kt_jvm_binary", + _kt_jvm_import = "kt_jvm_import", + _kt_jvm_library = "kt_jvm_library", + _kt_jvm_test = "kt_jvm_test", +) load( ":lint.bzl", _ktlint_config = "ktlint_config", _ktlint_fix = "ktlint_fix", _ktlint_test = "ktlint_test", ) -load( - ":core.bzl", - _define_kt_toolchain = "define_kt_toolchain", - _kt_compiler_plugin = "kt_compiler_plugin", - _kt_ksp_plugin = "kt_ksp_plugin", - _kt_register_toolchains = "kt_register_toolchains", -) define_kt_toolchain = _define_kt_toolchain kt_register_toolchains = _kt_register_toolchains diff --git a/kotlin/settings/BUILD.bazel b/kotlin/settings/BUILD.bazel index eb9e21a2e..9153b65f3 100644 --- a/kotlin/settings/BUILD.bazel +++ b/kotlin/settings/BUILD.bazel @@ -1,3 +1,5 @@ +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") + # Copyright 2020 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,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("@bazel_skylib//rules:common_settings.bzl", "bool_flag") release_archive( name = "pkg", diff --git a/src/main/kotlin/BUILD b/src/main/kotlin/BUILD index db305906f..5e16b17b0 100644 --- a/src/main/kotlin/BUILD +++ b/src/main/kotlin/BUILD @@ -1,5 +1,5 @@ -load("//third_party:jarjar.bzl", "jar_jar") load("//src/main/starlark/release:packager.bzl", "release_archive") +load("//third_party:jarjar.bzl", "jar_jar") exports_files( ["shade.jarjar"], diff --git a/src/main/kotlin/bootstrap.bzl b/src/main/kotlin/bootstrap.bzl index 9b2c9ce97..cdca22d45 100644 --- a/src/main/kotlin/bootstrap.bzl +++ b/src/main/kotlin/bootstrap.bzl @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@rules_java//java:defs.bzl", "java_binary", "java_import") -load("//third_party:jarjar.bzl", "jar_jar") load("//kotlin:jvm.bzl", _for_ide = "kt_jvm_library") load("//kotlin:lint.bzl", _ktlint_fix = "ktlint_fix", _ktlint_test = "ktlint_test") +load("//third_party:jarjar.bzl", "jar_jar") _BOOTSTRAP_LIB_ARGS = ["-jvm-target", "1.8"] diff --git a/src/main/kotlin/io/bazel/kotlin/plugin/BUILD.bazel b/src/main/kotlin/io/bazel/kotlin/plugin/BUILD.bazel index dc1cd8502..e647dc545 100644 --- a/src/main/kotlin/io/bazel/kotlin/plugin/BUILD.bazel +++ b/src/main/kotlin/io/bazel/kotlin/plugin/BUILD.bazel @@ -13,8 +13,8 @@ # limitations under the License. load("@rules_java//java:defs.bzl", "java_binary") -load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library") load("//kotlin/internal/utils:generate_jvm_service.bzl", "generate_jvm_service") +load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library") # The compiler binary, this is co-located in the kotlin compiler classloader. kt_bootstrap_library( diff --git a/src/main/kotlin/io/bazel/kotlin/plugin/jdeps/BUILD.bazel b/src/main/kotlin/io/bazel/kotlin/plugin/jdeps/BUILD.bazel index 48a6f1bf8..d565ed716 100644 --- a/src/main/kotlin/io/bazel/kotlin/plugin/jdeps/BUILD.bazel +++ b/src/main/kotlin/io/bazel/kotlin/plugin/jdeps/BUILD.bazel @@ -13,8 +13,8 @@ # limitations under the License. load("@rules_java//java:defs.bzl", "java_binary") -load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library") load("//kotlin/internal/utils:generate_jvm_service.bzl", "generate_jvm_service") +load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library") # The compiler binary, this is co-located in the kotlin compiler classloader. kt_bootstrap_library( diff --git a/src/main/kotlin/io/bazel/worker/BUILD.bazel b/src/main/kotlin/io/bazel/worker/BUILD.bazel index bcf4161bf..246b618db 100644 --- a/src/main/kotlin/io/bazel/worker/BUILD.bazel +++ b/src/main/kotlin/io/bazel/worker/BUILD.bazel @@ -1,6 +1,7 @@ +load("@rules_java//java:defs.bzl", "java_binary", "java_import") + # General purpose Bazel worker implemented Kotlin. Best suited for jvm based tools. load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library") -load("@rules_java//java:defs.bzl", "java_binary", "java_import") java_binary( name = "worker_proto_bundle_bin", diff --git a/src/main/protobuf/BUILD b/src/main/protobuf/BUILD index 6377833ef..fc31054d5 100644 --- a/src/main/protobuf/BUILD +++ b/src/main/protobuf/BUILD @@ -1,5 +1,5 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_java//java:defs.bzl", "java_library", "java_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/starlark/BUILD.bazel b/src/main/starlark/BUILD.bazel index 39795f02f..dbe49c802 100644 --- a/src/main/starlark/BUILD.bazel +++ b/src/main/starlark/BUILD.bazel @@ -1,5 +1,5 @@ -load("//src/main/starlark/release:packager.bzl", "release_archive") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("//src/main/starlark/release:packager.bzl", "release_archive") release_archive( name = "pkg", diff --git a/src/main/starlark/core/BUILD.bazel b/src/main/starlark/core/BUILD.bazel index e1626e812..7cb934ba0 100644 --- a/src/main/starlark/core/BUILD.bazel +++ b/src/main/starlark/core/BUILD.bazel @@ -1,5 +1,5 @@ -load("//src/main/starlark/release:packager.bzl", "release_archive") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("//src/main/starlark/release:packager.bzl", "release_archive") release_archive( name = "pkg", diff --git a/src/main/starlark/core/options/BUILD.bazel b/src/main/starlark/core/options/BUILD.bazel index 59d6a7d7e..6512aeb1b 100644 --- a/src/main/starlark/core/options/BUILD.bazel +++ b/src/main/starlark/core/options/BUILD.bazel @@ -1,5 +1,5 @@ -load("//src/main/starlark/release:packager.bzl", "release_archive") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("//src/main/starlark/release:packager.bzl", "release_archive") release_archive( name = "pkg", diff --git a/src/main/starlark/core/options/opts.javac.bzl b/src/main/starlark/core/options/opts.javac.bzl index b388110d8..bfad8c8a5 100644 --- a/src/main/starlark/core/options/opts.javac.bzl +++ b/src/main/starlark/core/options/opts.javac.bzl @@ -12,8 +12,8 @@ # 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") +load("//src/main/starlark/core/options:derive.bzl", "derive") _JOPTS = { "warn": struct( diff --git a/src/main/starlark/core/options/opts.kotlinc.bzl b/src/main/starlark/core/options/opts.kotlinc.bzl index aa9d7d98a..77ed634db 100644 --- a/src/main/starlark/core/options/opts.kotlinc.bzl +++ b/src/main/starlark/core/options/opts.kotlinc.bzl @@ -12,8 +12,8 @@ # 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") +load("//src/main/starlark/core/options:convert.bzl", "convert") def _map_optin_class_to_flag(values): return ["-opt-in=%s" % v for v in values] diff --git a/src/main/starlark/core/repositories/BUILD b/src/main/starlark/core/repositories/BUILD index f0974a6f0..b5bc2e26f 100644 --- a/src/main/starlark/core/repositories/BUILD +++ b/src/main/starlark/core/repositories/BUILD @@ -1,3 +1,5 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +14,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("@bazel_skylib//:bzl_library.bzl", "bzl_library") release_archive( name = "pkg", diff --git a/src/main/starlark/core/repositories/initialize.bzl b/src/main/starlark/core/repositories/initialize.bzl index 5e27d33da..c2675bfd1 100644 --- a/src/main/starlark/core/repositories/initialize.bzl +++ b/src/main/starlark/core/repositories/initialize.bzl @@ -14,13 +14,13 @@ """This file contains the Kotlin compiler repository definitions. It should not be loaded directly by client workspaces. """ -load(":setup.bzl", "kt_configure") load( ":initialize.release.bzl", _kotlinc_version = "kotlinc_version", _ksp_version = "ksp_version", _release_kotlin_repositories = "kotlin_repositories", ) +load(":setup.bzl", "kt_configure") load(":versions.bzl", _versions = "versions") #exports diff --git a/src/main/starlark/core/repositories/initialize.release.bzl b/src/main/starlark/core/repositories/initialize.release.bzl index 23ebb49b3..bebad3386 100644 --- a/src/main/starlark/core/repositories/initialize.release.bzl +++ b/src/main/starlark/core/repositories/initialize.release.bzl @@ -14,17 +14,17 @@ """This file contains the Kotlin compiler repository definitions. It should not be loaded directly by client workspaces. """ -load( - "//kotlin/internal:defs.bzl", - _KSP_COMPILER_PLUGIN_REPO = "KSP_COMPILER_PLUGIN_REPO", - _KT_COMPILER_REPO = "KT_COMPILER_REPO", -) load( "@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file", ) load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +load( + "//kotlin/internal:defs.bzl", + _KSP_COMPILER_PLUGIN_REPO = "KSP_COMPILER_PLUGIN_REPO", + _KT_COMPILER_REPO = "KT_COMPILER_REPO", +) load(":compiler.bzl", "kotlin_compiler_repository") load(":ksp.bzl", "ksp_compiler_plugin_repository") load(":versions.bzl", "version", _versions = "versions") diff --git a/src/main/starlark/core/repositories/setup.bzl b/src/main/starlark/core/repositories/setup.bzl index 00e96a0c5..eb19270bc 100644 --- a/src/main/starlark/core/repositories/setup.bzl +++ b/src/main/starlark/core/repositories/setup.bzl @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") -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("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories") +load("@rules_jvm_external//:defs.bzl", "maven_install") load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") def kt_configure(): """Setup dependencies. Must be called AFTER kt_download_local_dev_dependencies() """ diff --git a/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel b/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel index 6f08269ab..34982d6ed 100644 --- a/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel +++ b/src/test/kotlin/io/bazel/kotlin/builder/tasks/BUILD.bazel @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_test") load("@rules_java//java:defs.bzl", "java_library") +load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_test") java_library( name = "JdepsParserTestFixtures", diff --git a/src/test/kotlin/io/bazel/kotlin/builder/utils/BUILD.bazel b/src/test/kotlin/io/bazel/kotlin/builder/utils/BUILD.bazel index 023d75db0..ac51c7dcf 100644 --- a/src/test/kotlin/io/bazel/kotlin/builder/utils/BUILD.bazel +++ b/src/test/kotlin/io/bazel/kotlin/builder/utils/BUILD.bazel @@ -1,5 +1,5 @@ -load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_test") load("//kotlin:jvm.bzl", "kt_jvm_test") +load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_test") # Copyright 2020 The Bazel Authors. All rights reserved. # diff --git a/third_party/BUILD b/third_party/BUILD index 056480be0..624fe5f8c 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -1,6 +1,6 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@rules_java//java:defs.bzl", "java_binary", "java_import", "java_library", "java_plugin") load("//src/main/starlark/release:packager.bzl", "release_archive") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") # Copyright 2018 The Bazel Authors. All rights reserved. #