Skip to content

Commit

Permalink
Restore lint, remove hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
restingbull committed Dec 8, 2023
1 parent bebfc11 commit 30c29c5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 0 additions & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ tasks:
name: "Example - Trivial Bzlmod (Ubuntu 18.04)"
platform: ubuntu1804
working_directory: examples/trivial
- bazel clean --expunge --async && bazel shutdown
build_flags:
- "--enable_bzlmod=true"
test_flags:
Expand Down
21 changes: 20 additions & 1 deletion src/main/kotlin/bootstrap.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
# limitations under the License.
load("@released_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@rules_java//java:defs.bzl", "java_binary")
load("//kotlin:lint.bzl", _ktlint_fix = "ktlint_fix", _ktlint_test = "ktlint_test")
load("//third_party:jarjar.bzl", "jar_jar")

def kt_bootstrap_library(name, deps = [], neverlink_deps = [], **kwargs):
def kt_bootstrap_library(name, deps = [], neverlink_deps = [], srcs = [], **kwargs):
"""
Simple compilation of a kotlin library using a non-persistent worker. The target is a JavaInfo provider.
Expand All @@ -34,6 +35,24 @@ def kt_bootstrap_library(name, deps = [], neverlink_deps = [], **kwargs):
**kwargs
)

_ktlint_test(
name = "%s_ktlint_test" % name,
srcs = srcs,
visibility = ["//visibility:private"],
config = "//:ktlint_editorconfig",
tags = ["no-ide", "ktlint"],
)

_ktlint_fix(
name = "%s_ktlint_fix" % name,
srcs = srcs,
visibility = ["//visibility:private"],
config = "//:ktlint_editorconfig",
tags = ["no-ide", "ktlint"],
deps = deps + ["%s_neverlink" % name],
**kwargs
)

def kt_bootstrap_binary(
name,
main_class,
Expand Down

0 comments on commit 30c29c5

Please sign in to comment.