Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/android/libKtAndroid/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/dagger/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down
2 changes: 1 addition & 1 deletion examples/jetpack_compose/BUILD
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 3 additions & 2 deletions examples/ksp/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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"])
Expand Down
3 changes: 2 additions & 1 deletion examples/node/coroutines-helloworld/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion examples/node/express/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/plugin/src/allopen/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/plugin/src/noarg/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/plugin/src/parcelize/BUILD
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
2 changes: 1 addition & 1 deletion examples/plugin/src/sam_with_receiver/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion kotlin/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion kotlin/compiler/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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"])

Expand Down
4 changes: 2 additions & 2 deletions kotlin/compiler/compiler.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "//:"
Expand Down
10 changes: 5 additions & 5 deletions kotlin/core.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion kotlin/internal/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion kotlin/internal/js/BUILD
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion kotlin/internal/jvm/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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"])

Expand Down
11 changes: 6 additions & 5 deletions kotlin/internal/jvm/android.bzl
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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")

Expand Down
19 changes: 10 additions & 9 deletions kotlin/internal/jvm/compile.bzl
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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",
Expand All @@ -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 ##############################################################################################################
Expand Down
17 changes: 9 additions & 8 deletions kotlin/internal/jvm/impl.bzl
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kotlin/internal/lint/ktlint_test.bzl
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
12 changes: 6 additions & 6 deletions kotlin/internal/opts.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions kotlin/internal/toolchains.bzl
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion kotlin/internal/utils/BUILD
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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",
Expand Down
Loading